From: Ivan Kohler Date: Sat, 26 Aug 2017 23:39:16 +0000 (-0700) Subject: add 54-g agent_custid format, RT#77110 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5e489861dba968c011f7cd539d806ab45acc210a add 54-g agent_custid format, RT#77110 --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 715733667..e0087df27 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4310,6 +4310,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 4eab474e1..27559d73d 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;