[freeside-commits] branch master updated. a80456f3f7f775cc50d343a7bcaef69e83f96c42
Ivan
ivan at 420.am
Fri Mar 11 18:42:14 PST 2016
The branch, master has been updated
via a80456f3f7f775cc50d343a7bcaef69e83f96c42 (commit)
from ae817d8bbd220b645f41cb2d020ba8b6b739765b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a80456f3f7f775cc50d343a7bcaef69e83f96c42
Author: Ivan Kohler <ivan at freeside.biz>
Date: Fri Mar 11 18:42:13 2016 -0800
fix customer package browse selection, RT#39822
diff --git a/FS/FS/cust_main/Packages.pm b/FS/FS/cust_main/Packages.pm
index 1c921d6..13c2945 100644
--- a/FS/FS/cust_main/Packages.pm
+++ b/FS/FS/cust_main/Packages.pm
@@ -434,7 +434,7 @@ sub all_pkgs {
my $self = shift;
my $extra_qsearch = ref($_[0]) ? shift : { @_ };
- return $self->num_pkgs unless wantarray || keys %$extra_qsearch;
+ return $self->num_pkgs($extra_qsearch) unless wantarray;
my @cust_pkg = ();
if ( $self->{'_pkgnum'} && ! keys %$extra_qsearch ) {
@@ -464,11 +464,11 @@ Returns all non-cancelled packages (see L<FS::cust_pkg>) for this customer.
sub ncancelled_pkgs {
my $self = shift;
- my $extra_qsearch = ref($_[0]) ? shift : {};
+ my $extra_qsearch = ref($_[0]) ? shift : { @_ };
local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
- return $self->num_ncancelled_pkgs unless wantarray;
+ return $self->num_ncancelled_pkgs($extra_qsearch) unless wantarray;
my @cust_pkg = ();
if ( $self->{'_pkgnum'} ) {
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html
index 9add4b2..33ffecc 100755
--- a/httemplate/view/cust_main/packages.html
+++ b/httemplate/view/cust_main/packages.html
@@ -302,8 +302,8 @@ if ( $cgi->param('locationnum') =~ /^(\d+)$/ ) {
my $total_pkgs = $cust_main->all_pkgs;
-my $num_method = $hide_cancelled ? 'ncancelled_pkgs' : 'all_pkgs';
-my $num_pkgs = $cust_main->$num_method({
+my $method = $hide_cancelled ? 'ncancelled_pkgs' : 'all_pkgs';
+my $num_pkgs = $cust_main->$method({
'addl_from' => $addl_from,
'extra_sql' => $extra_sql,
});
@@ -311,7 +311,7 @@ my $num_pkgs = $cust_main->$num_method({
my $maxrecords = 10;
my $offset = $cgi->param('offset') =~ /^(\d+)$/ ? $1 : 0;
-my @packages = $cust_main->all_pkgs( {
+my @packages = $cust_main->$method( {
'select' => "$cust_pkg_fields, $part_pkg_fields, $num_svcs",
'addl_from' => $addl_from. "
LEFT JOIN part_pkg_option AS setup_option
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cust_main/Packages.pm | 6 +++---
httemplate/view/cust_main/packages.html | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
More information about the freeside-commits
mailing list