summaryrefslogtreecommitdiff
path: root/FS/FS/cust_main.pm
diff options
context:
space:
mode:
authorivan <ivan>2008-01-11 23:10:47 +0000
committerivan <ivan>2008-01-11 23:10:47 +0000
commitb71d9008c9dc7cdeddfc968ae8164ff96e443196 (patch)
tree6bb75531b7dfba6272c0f7a484a035bd34ab7afd /FS/FS/cust_main.pm
parent931aa447df899ead7e5dd6ded2243d5288f8df6f (diff)
add option to enable searching of cust_main.agent_custid with one or two letter prefix before the numeric part
Diffstat (limited to 'FS/FS/cust_main.pm')
-rw-r--r--FS/FS/cust_main.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index ff441dbc0..09a0cfd99 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -5328,10 +5328,14 @@ sub smart_search {
}
- } elsif ( $search =~ /^\s*(\d+)\s*$/ ) { # customer # search
- # (also try agent_custid)
- # (regex needs tweaking if your
- # legacy cust numbers have letters)
+ # 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*$/
+ )
+ )
+ {
push @cust_main, qsearch( {
'table' => 'cust_main',