diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-06-28 15:22:15 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-06-28 15:22:15 -0700 |
commit | cf7cd8efc7095aadbdfb0cd8e7ea0e2e8b9e9085 (patch) | |
tree | 21663465e6978ee2bf19da393045d4f42af9508d | |
parent | 56b2078e23a588b3b5c1087635bf2442b565d075 (diff) |
add advertising source to advanced customer report, RT#18354
-rw-r--r-- | FS/FS/cust_main/Search.pm | 13 | ||||
-rwxr-xr-x | httemplate/search/cust_main.html | 3 | ||||
-rwxr-xr-x | 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, + &> + <TR> <TD ALIGN="right" VALIGN="center"><% mt('Address') |h %></TD> <TD><INPUT TYPE="text" NAME="address" SIZE=54></TD> @@ -129,11 +135,6 @@ &> <TR> - <TD ALIGN="right" VALIGN="center"><% mt('Include cancelled packages') |h %></TD> - <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD> - </TR> - - <TR> <TD ALIGN="right" VALIGN="center"><% mt('Without census tract') |h %></TD> <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD> </TR> @@ -160,6 +161,12 @@ <TD ALIGN="right" VALIGN="center"><% mt('Add package columns') |h %></TD> <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD> </TR> + + <TR> + <TD ALIGN="right" VALIGN="center"><% mt('Include cancelled packages') |h %></TD> + <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD> + </TR> + </TABLE> <BR> |