[freeside-commits] branch FREESIDE_2_3_BRANCH updated. e6c63380905a96364738715cfb59e408f17fb775

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


The branch, FREESIDE_2_3_BRANCH has been updated
       via  e6c63380905a96364738715cfb59e408f17fb775 (commit)
      from  a96c4cedb16a3d130ca9c1f3e7fba3e47ef7503e (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 e6c63380905a96364738715cfb59e408f17fb775
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Jun 28 15:22:19 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 4b159ff..ec1bd3d 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -578,8 +578,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