[freeside-commits] branch FREESIDE_3_BRANCH updated. de9c24de9f0d26ddaee02915f5684884eced5ff0

Christopher Burger burgerc at freeside.biz
Tue May 28 09:43:38 PDT 2019


The branch, FREESIDE_3_BRANCH has been updated
       via  de9c24de9f0d26ddaee02915f5684884eced5ff0 (commit)
       via  d0ccab3fd755d1f3b81b8cfc27e99665ee3f20ec (commit)
      from  af9ff3772e41d0464c024364157d92ac1e679c10 (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 de9c24de9f0d26ddaee02915f5684884eced5ff0
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue May 28 10:55:29 2019 -0400

    RT# 77532 - fixed error where cust main fax not showing, and fixed checking of phonetypenum
    
    Conflicts:
            httemplate/search/cust_main.html
            httemplate/view/cust_main/contacts_new.html

diff --git a/FS/FS/ConfDefaults.pm b/FS/FS/ConfDefaults.pm
index f073252af..d1c3171f1 100644
--- a/FS/FS/ConfDefaults.pm
+++ b/FS/FS/ConfDefaults.pm
@@ -36,7 +36,7 @@ sub cust_fields_avail { (
   'Agent | Agent Cust# or Cust# | Cust. Status | Customer' =>
     'Agent | Agent Cust# | Status | Last, First or Company (Last, First)',
 
-  "Customer | Day phone | Night phone | Mobile phone | Fax number | Contact phone(s)" =>
+  'Customer | Day phone | Night phone | Mobile phone | Fax number | Contact phone(s)' =>
     'Customer | (all phones)',
   'Cust# | Customer | Day phone | Night phone | Mobile phone | Fax number | Contact phone(s)' =>
     'custnum | Customer | (all phones)',
diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm
index 33a9702a2..c2a600629 100644
--- a/FS/FS/UI/Web.pm
+++ b/FS/FS/UI/Web.pm
@@ -471,7 +471,7 @@ sub cust_sql_fields {
     }
   }
 
-  foreach my $field (qw(daytime night mobile fax )) {
+  foreach my $field (qw(daytime night mobile fax)) {
     push @fields, $field if (grep { $_ eq $field } @cust_fields);
   }
   push @fields, "payby AS cust_payby"
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 8073ce102..a12846c1c 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -795,7 +795,7 @@ sub search {
   # phones
   ##
 
-  foreach my $phonet (qw(daytime night mobile)) {
+  foreach my $phonet (qw(daytime night mobile fax)) {
     if ($params->{$phonet}) {
       $params->{$phonet} =~ s/\D//g;
       $params->{$phonet} =~ /^(\d{3})(\d{3})(\d{4})(\d*)$/
diff --git a/FS/FS/phone_type.pm b/FS/FS/phone_type.pm
index 9439cd09b..d5c43afd5 100644
--- a/FS/FS/phone_type.pm
+++ b/FS/FS/phone_type.pm
@@ -98,8 +98,8 @@ returns a list of phone_types.
 =cut
 
 sub get_phone_types {
-  ## only using mobile(3) and work(1) right now.
-  my @phone_types = qsearch({table=>'phone_type', order_by=>'ORDER BY weight DESC', extra_sql => " WHERE phonetypenum IN ('1','3')"});
+  ## not using Home and Fax right now. false laziness with  /elements/contact.html
+  my @phone_types = qsearch({table=>'phone_type', order_by=>'ORDER BY weight DESC', extra_sql => " WHERE typename NOT IN ('Home','Fax')"});
   return @phone_types;
 }
 
diff --git a/httemplate/elements/select-cust-fields.html b/httemplate/elements/select-cust-fields.html
index 63e92ac3d..833f7c1af 100644
--- a/httemplate/elements/select-cust-fields.html
+++ b/httemplate/elements/select-cust-fields.html
@@ -6,7 +6,7 @@
   foreach my $phone_type ( FS::phone_type->get_phone_types() ) {
     $contact_phone_list .= " | Contact ".$phone_type->typename." phone(s)";
   }
-  @fields = map {s/\| Contact phone\(s\)/$contact_phone_list/g; $_; } @fields;
+  @fields = map {s/ \| Contact phone\(s\)/$contact_phone_list/g; $_; } @fields;
 
   $opt{'avail_fields'} ||= [ @fields ];
 
diff --git a/httemplate/elements/tr-select-cust-fields.html b/httemplate/elements/tr-select-cust-fields.html
index 46228fee4..8a54e51ff 100644
--- a/httemplate/elements/tr-select-cust-fields.html
+++ b/httemplate/elements/tr-select-cust-fields.html
@@ -13,7 +13,7 @@ my $contact_phone_list;
 foreach my $phone_type ( FS::phone_type->get_phone_types() ) {
   $contact_phone_list .= " | Contact ".$phone_type->typename." phone(s)";
 }
- at fields = map {s/\| Contact phone\(s\)/$contact_phone_list/g; $_; } @fields;
+ at fields = map {s/ \| Contact phone\(s\)/$contact_phone_list/g; $_; } @fields;
 
 $opt{'avail_fields'} ||= [ @fields ];
 
diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html
index 4d5d18fe8..c3b01eb35 100755
--- a/httemplate/search/cust_main.html
+++ b/httemplate/search/cust_main.html
@@ -51,7 +51,7 @@ my %search_hash = ();
 my @scalars = qw (
   agentnum salesnum status
   address city county state zip country location_history
-  daytime night mobile
+  daytime night mobile fax
   paydate_year paydate_month 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
index de62119f9..c7a41eba5 100644
--- a/httemplate/search/elements/cust_main_phones.html
+++ b/httemplate/search/elements/cust_main_phones.html
@@ -3,7 +3,7 @@
   <TD COLSPAN=6>
     <TABLE CELLSPACING=0 CELLPADDING=0>
       <TR>
-% foreach my $phone (qw(daytime night mobile)) {
+% foreach my $phone (qw(daytime night mobile fax)) {
         <TD>
           <INPUT TYPE="text"
                  NAME="<% $phone %>"
@@ -23,5 +23,6 @@ my %phone_label = (
   daytime => 'Day Phone',
   night   => 'Night Phone',
   mobile  => 'Mobile Phone',
+  fax     => 'Fax Number',
 );
 </%init>
\ No newline at end of file

commit d0ccab3fd755d1f3b81b8cfc27e99665ee3f20ec
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
    
    Conflicts:
            httemplate/search/cust_main.html
            httemplate/search/report_cust_main.html

diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index fcb3efc3b..8073ce102 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -791,6 +791,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 62e4a2706..4d5d18fe8 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
   paydate_year paydate_month 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..de62119f9
--- /dev/null
+++ b/httemplate/search/elements/cust_main_phones.html
@@ -0,0 +1,27 @@
+<TR>
+  <TD 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 47d46e1cd..18b0fd1e5 100755
--- a/httemplate/search/report_cust_main.html
+++ b/httemplate/search/report_cust_main.html
@@ -223,6 +223,8 @@
       </TD>
     </TR>
 
+    <& elements/cust_main_phones.html &>
+
     <TR>
       <TH CLASS="background" COLSPAN=2> </TH>
     </TR>

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

Summary of changes:
 FS/FS/ConfDefaults.pm                                     |  2 +-
 FS/FS/UI/Web.pm                                           |  2 +-
 FS/FS/cust_main/Search.pm                                 | 15 +++++++++++++++
 FS/FS/phone_type.pm                                       |  4 ++--
 httemplate/elements/select-cust-fields.html               |  2 +-
 httemplate/elements/tr-select-cust-fields.html            |  2 +-
 httemplate/search/cust_main.html                          |  1 +
 .../phones.html => search/elements/cust_main_phones.html} | 13 ++++++-------
 httemplate/search/report_cust_main.html                   |  2 ++
 9 files changed, 30 insertions(+), 13 deletions(-)
 copy httemplate/{edit/cust_main/phones.html => search/elements/cust_main_phones.html} (62%)




More information about the freeside-commits mailing list