[freeside-commits] branch FREESIDE_3_BRANCH updated. 854285c1b4abfab0dc9f781026713dc05521d5e1

Ivan ivan at 420.am
Sat Aug 26 16:39:20 PDT 2017


The branch, FREESIDE_3_BRANCH has been updated
       via  854285c1b4abfab0dc9f781026713dc05521d5e1 (commit)
      from  c742a74ec444c4606006a14e814d06e0b1795ea4 (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 854285c1b4abfab0dc9f781026713dc05521d5e1
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Aug 26 16:39:19 2017 -0700

    add 54-g agent_custid format, RT#77110

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 77add5d..e32be95 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4580,6 +4580,7 @@ and customer address. Include units.',
                        ''       => 'Numeric only',
                        '\d{7}'  => 'Numeric only, exactly 7 digits',
                        'ww?d+'  => 'Numeric with one or two letter prefix',
+                       'd+-w'   => 'Numeric with a dash and one letter suffix',
                      ],
   },
 
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 7d0e43d..84108a0 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -161,20 +161,23 @@ sub smart_search {
 
   # custnum search (also try agent_custid), with some tweaking options if your
   # legacy cust "numbers" have letters
-  } elsif ( $search =~ /^\s*(\d+)\s*$/
-         || ( $conf->config('cust_main-agent_custid-format') eq 'ww?d+'
-              && $search =~ /^\s*(\w\w?\d+)\s*$/
-            )
-         || ( $conf->config('cust_main-custnum-display_special')
-           # it's not currently possible for special prefixes to contain
-           # digits, so just strip off any alphabetic prefix and match 
-           # the rest to custnum
-              && $search =~ /^\s*[[:alpha:]]*(\d+)\s*$/
-            )
-         || ( $conf->exists('address1-search' )
-              && $search =~ /^\s*(\d+\-?\w*)\s*$/ #i.e. 1234A or 9432-D
-            )
-     )
+  } elsif (    $search =~ /^\s*(\d+)\s*$/
+            or ( $conf->config('cust_main-agent_custid-format') eq 'ww?d+'
+                 && $search =~ /^\s*(\w\w?\d+)\s*$/
+               )
+            or ( $conf->config('cust_main-agent_custid-format') eq 'd+-w'
+                 && $search =~ /^\s*(\d+-\w)\s*$/
+               )
+            or ( $conf->config('cust_main-custnum-display_special')
+                 # it's not currently possible for special prefixes to contain
+                 # digits, so just strip off any alphabetic prefix and match 
+                 # the rest to custnum
+                 && $search =~ /^\s*[[:alpha:]]*(\d+)\s*$/
+               )
+            or ( $conf->exists('address1-search' )
+                 && $search =~ /^\s*(\d+\-?\w*)\s*$/ #i.e. 1234A or 9432-D
+               )
+          )
   {
 
     my $num = $1;

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

Summary of changes:
 FS/FS/Conf.pm             |    1 +
 FS/FS/cust_main/Search.pm |   31 +++++++++++++++++--------------
 2 files changed, 18 insertions(+), 14 deletions(-)




More information about the freeside-commits mailing list