[freeside-commits] branch master updated. cf7cd8efc7095aadbdfb0cd8e7ea0e2e8b9e9085

Ivan ivan at 420.am
Thu Jun 28 15:22:16 PDT 2012


The branch, master has been updated
       via  cf7cd8efc7095aadbdfb0cd8e7ea0e2e8b9e9085 (commit)
      from  56b2078e23a588b3b5c1087635bf2442b565d075 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cf7cd8efc7095aadbdfb0cd8e7ea0e2e8b9e9085
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Jun 28 15:22:15 2012 -0700

    add advertising source to advanced customer report, RT#18354

diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 3a8acb2..b528a68 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 cc71672..e164b98 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 04e04ee..39cf695 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>

-----------------------------------------------------------------------

Summary of changes:
 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(-)




More information about the freeside-commits mailing list