From ff359277b27645b286e1c98f686848f83819d2ba Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Mon, 13 Nov 2017 12:45:15 -0500 Subject: 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. --- FS/FS/cust_pkg/Search.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'FS') diff --git a/FS/FS/cust_pkg/Search.pm b/FS/FS/cust_pkg/Search.pm index 311dbdbe1..3e1ca820e 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'} ) { -- cgit v1.2.1