summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-11-13 12:45:15 -0500
committerChristopher Burger <burgerc@freeside.biz>2017-11-13 12:45:15 -0500
commit2554b11e48a7ec4567bf89f9a48f7a83ec925eea (patch)
tree4672d600d43e1c9f9874845eee3b7546ce22d33f /FS
parent63da5ded686cf29353617d4c51385da4906b749b (diff)
RT# 77470 - added reason option to advanced package report with suspended status is selected. Also added links to suspend and unsuspend when status active or suspended is used.
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_pkg/Search.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg/Search.pm b/FS/FS/cust_pkg/Search.pm
index 311dbdb..3e1ca82 100644
--- a/FS/FS/cust_pkg/Search.pm
+++ b/FS/FS/cust_pkg/Search.pm
@@ -627,6 +627,8 @@ sub search {
push @where, $FS::CurrentUser::CurrentUser->agentnums_sql('table'=>'cust_main');
}
+ push @where, "cust_pkg_reason.reasonnum = '".$params->{reasonnum}."'" if $params->{reasonnum};
+
my $extra_sql = scalar(@where) ? ' WHERE '. join(' AND ', @where) : '';
my $addl_from = 'LEFT JOIN part_pkg USING ( pkgpart ) '.
@@ -634,6 +636,10 @@ sub search {
'LEFT JOIN cust_location USING ( locationnum ) '.
FS::UI::Web::join_cust_main('cust_pkg', 'cust_pkg');
+ if ($params->{reasonnum}) {
+ $addl_from .= 'LEFT JOIN cust_pkg_reason ON (cust_pkg_reason.pkgnum = cust_pkg.pkgnum) ';
+ }
+
my $select;
my $count_query;
if ( $params->{'select_zip5'} ) {