diff options
author | Ivan Kohler <ivan@freeside.biz> | 2017-08-26 16:39:18 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2017-08-26 16:39:18 -0700 |
commit | 4d763e7c7d4c5f2dc9238f9f955a2211056d578c (patch) | |
tree | f39b9fbb2a14fa8fc3d54f074306a32ea9f06ffb /FS/FS/cust_main | |
parent | 0e31e1eebf37df6227de78fda8cb7a1172018e0e (diff) |
add 54-g agent_custid format, RT#77110
Diffstat (limited to 'FS/FS/cust_main')
-rw-r--r-- | FS/FS/cust_main/Search.pm | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index 4eab474..27559d7 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; |