From 47c250d15d752e6210b9c044a4a64e2e8992c64e Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 10 Oct 2013 23:13:09 -0700 Subject: [PATCH] add customer status to advanced package report, RT#24631 --- FS/FS/cust_pkg.pm | 8 ++++++++ httemplate/search/cust_pkg.cgi | 4 ++-- httemplate/search/report_cust_pkg.html | 12 +++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 0cb1b50a2..066b98755 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -4179,6 +4179,14 @@ sub search { } ## + # parse cust_status + ## + + if ( $params->{'cust_status'} =~ /^([a-z]+)$/ ) { + push @where, FS::cust_main->cust_status_sql . " = '$1' "; + } + + ## # parse customer sales person ## diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index 32b5a69e8..995779a46 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -156,8 +156,8 @@ my %search_hash = (); $search_hash{'query'} = $cgi->keywords; #scalars -for (qw( agentnum cust_main_salesnum salesnum custnum magic status custom - cust_fields pkgbatch +for (qw( agentnum cust_status cust_main_salesnum salesnum custnum magic status + custom cust_fields pkgbatch )) { $search_hash{$_} = $cgi->param($_) if length($cgi->param($_)); diff --git a/httemplate/search/report_cust_pkg.html b/httemplate/search/report_cust_pkg.html index 0a17344b8..b8c32c631 100755 --- a/httemplate/search/report_cust_pkg.html +++ b/httemplate/search/report_cust_pkg.html @@ -13,12 +13,17 @@ % unless ( $custnum ) { - <% include( '/elements/tr-select-agent.html', + + <& /elements/tr-select-agent.html, 'curr_value' => scalar( $cgi->param('agentnum') ), 'disable_empty' => 0, 'onchange' => 'agent_changed(this)', - ) - %> + &> + + <& /elements/tr-select-cust_main-status.html, + 'label' => 'Customer status', + 'field' => 'cust_status', + &>