[freeside-commits] branch master updated. 6b5dda03831aef0cb5689cf2acf3fac47e4b12cb

Christopher Burger burgerc at freeside.biz
Fri May 24 07:52:39 PDT 2019


The branch, master has been updated
       via  6b5dda03831aef0cb5689cf2acf3fac47e4b12cb (commit)
      from  562a3c85e49cd3ea8fb80e5c2fd7f4c5f60333e9 (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 6b5dda03831aef0cb5689cf2acf3fac47e4b12cb
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Fri May 24 10:51:08 2019 -0400

    RT# 77532 - can search cust main phone numbers in advanced customer search

diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 63f10fb64..479ebf5c4 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -789,6 +789,21 @@ sub search {
     )";
   }
 
+  ##
+  # phones
+  ##
+
+  foreach my $phonet (qw(daytime night mobile)) {
+    if ($params->{$phonet}) {
+      $params->{$phonet} =~ s/\D//g;
+      $params->{$phonet} =~ /^(\d{3})(\d{3})(\d{4})(\d*)$/
+        or next;
+      my $phonen = "$1-$2-$3";
+      if ($4) { push @where, "cust_main.".$phonet." = '".$phonen." x$4'"; }
+      else { push @where, "cust_main.".$phonet." like '".$phonen."%'"; }
+    }
+  }
+
   ###
   # refnum
   ###
diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html
index 83ca7217d..06a0d5428 100755
--- a/httemplate/search/cust_main.html
+++ b/httemplate/search/cust_main.html
@@ -51,6 +51,7 @@ my %search_hash = ();
 my @scalars = qw (
   agentnum salesnum status
   address city county state zip country location_history
+  daytime night mobile
   invoice_terms
   no_censustract with_geocode with_email tax no_tax POST no_POST
   custbatch usernum
diff --git a/httemplate/search/elements/cust_main_phones.html b/httemplate/search/elements/cust_main_phones.html
new file mode 100644
index 000000000..61aa1be6e
--- /dev/null
+++ b/httemplate/search/elements/cust_main_phones.html
@@ -0,0 +1,27 @@
+<TR>
+  <TH VALIGN="top" ALIGN="right"><% mt('Phones') |h %></TD>
+  <TD COLSPAN=6>
+    <TABLE CELLSPACING=0 CELLPADDING=0>
+      <TR>
+% foreach my $phone (qw(daytime night mobile)) {
+        <TD>
+          <INPUT TYPE="text"
+                 NAME="<% $phone %>"
+                 VALUE=""
+                 SIZE=18
+          >
+          <BR><FONT SIZE=-1 COLOR="#333333"><% mt($phone_label{$phone}) |h %></FONT>
+        </TD>
+        <TD> </TD>
+% }
+      </TR>
+    </TABLE>
+  </TD>
+</TR>
+<%init>
+my %phone_label = (
+  daytime => 'Day Phone',
+  night   => 'Night Phone',
+  mobile  => 'Mobile Phone',
+);
+</%init>
\ No newline at end of file
diff --git a/httemplate/search/report_cust_main.html b/httemplate/search/report_cust_main.html
index da2f1a4e9..3dd92af2e 100755
--- a/httemplate/search/report_cust_main.html
+++ b/httemplate/search/report_cust_main.html
@@ -165,6 +165,7 @@
   <FONT CLASS="fsinnerbox-title"><% emt('Location search options') %></FONT>
   <TABLE CLASS="fsinnerbox">
     <& elements/options_cust_location.html &>
+    <& elements/cust_main_phones.html &>
   </TABLE>
   <BR>
 

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

Summary of changes:
 FS/FS/cust_main/Search.pm                                 | 15 +++++++++++++++
 httemplate/search/cust_main.html                          |  1 +
 .../phones.html => search/elements/cust_main_phones.html} |  8 +++-----
 httemplate/search/report_cust_main.html                   |  1 +
 4 files changed, 20 insertions(+), 5 deletions(-)
 copy httemplate/{edit/cust_main/phones.html => search/elements/cust_main_phones.html} (80%)




More information about the freeside-commits mailing list