summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2008-01-11 23:10:55 +0000
committerivan <ivan>2008-01-11 23:10:55 +0000
commit2c980970df3e481e64eb824b33701d24cb4f21b2 (patch)
tree212066817461b7026d4f4a1f3b1f09ce19a41f72
parentde69678c382c614b417052ef9f71e0f1e279d337 (diff)
add option to enable searching of cust_main.agent_custid with one or two letter prefix before the numeric part
-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 af25ac424..7d700972d 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -4756,10 +4756,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',