From cf7cd8efc7095aadbdfb0cd8e7ea0e2e8b9e9085 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 28 Jun 2012 15:22:15 -0700 Subject: [PATCH] add advertising source to advanced customer report, RT#18354 --- FS/FS/cust_main/Search.pm | 13 +++++++++++-- httemplate/search/cust_main.html | 3 +-- httemplate/search/report_cust_main.html | 17 ++++++++++++----- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index 3a8acb2de..b528a689c 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -577,8 +577,17 @@ sub search { ### # refnum ### - if ( $params->{'refnum'} =~ /^(\d+)$/ ) { - push @where, "refnum = $1"; + if ( $params->{'refnum'} ) { + + my @refnum = ref( $params->{'refnum'} ) + ? @{ $params->{'refnum'} } + : ( $params->{'refnum'} ); + + @refnum = grep /^(\d*)$/, @refnum; + + push @where, '( '. join(' OR ', map "cust_main.refnum = $_", @refnum ). ' )' + if @refnum; + } ## diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index cc71672d0..e164b98f4 100755 --- a/httemplate/search/cust_main.html +++ b/httemplate/search/cust_main.html @@ -45,7 +45,6 @@ my @scalars = qw ( no_censustract with_geocode custbatch usernum cancelled_pkgs cust_fields flattened_pkgs - refnum ); for my $param ( @scalars ) { @@ -54,7 +53,7 @@ for my $param ( @scalars ) { } #lists -for my $param (qw( classnum payby tagnum )) { +for my $param (qw( classnum refnum payby tagnum )) { $search_hash{$param} = [ $cgi->param($param) ]; } diff --git a/httemplate/search/report_cust_main.html b/httemplate/search/report_cust_main.html index 04e04ee82..39cf695d8 100755 --- a/httemplate/search/report_cust_main.html +++ b/httemplate/search/report_cust_main.html @@ -25,6 +25,12 @@ 'all_selected' => 1, &> + <& /elements/tr-select-part_referral.html, + 'label' => emt('Advertising Source'), + 'multiple' => 1, + 'all_selected' => 1, + &> + <% mt('Address') |h %> @@ -129,11 +135,6 @@ &> - <% mt('Include cancelled packages') |h %> - - - - <% mt('Without census tract') |h %> @@ -160,6 +161,12 @@ <% mt('Add package columns') |h %> + + + <% mt('Include cancelled packages') |h %> + + +
-- 2.11.0