diff options
author | ivan <ivan> | 2007-12-18 20:58:26 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-12-18 20:58:26 +0000 |
commit | c1b06d26eff3badc8a2da8e3196b89289bdcde21 (patch) | |
tree | 9db15100f73e7f716aa599eb6e129384cf4bb611 | |
parent | aaa30aa5c72fee30f12bad04976cd3bfddfec35f (diff) |
legacy agent_custid field should be as searchable as actual custnum, right? at least if it is a number...
-rw-r--r-- | FS/FS/cust_main.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index db7d88a60..2a951cae6 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -4629,6 +4629,9 @@ sub smart_search { } } elsif ( $search =~ /^\s*(\d+)\s*$/ ) { # customer # search + # (also try agent_custid) + # (regex needs tweaking if your + # legacy cust numbers have letters) push @cust_main, qsearch( { 'table' => 'cust_main', @@ -4636,6 +4639,12 @@ sub smart_search { 'extra_sql' => " AND $agentnums_sql", #agent virtualization } ); + push @cust_main, qsearch( { + 'table' => 'cust_main', + 'hashref' => { 'agent_custid' => $1, %options }, + 'extra_sql' => " AND $agentnums_sql", #agent virtualization + } ); + } elsif ( $search =~ /^\s*(\S.*\S)\s+\((.+), ([^,]+)\)\s*$/ ) { my($company, $last, $first) = ( $1, $2, $3 ); |