From: ivan Date: Tue, 18 Dec 2007 20:58:26 +0000 (+0000) Subject: legacy agent_custid field should be as searchable as actual custnum, right? at least... X-Git-Tag: freeside_1_7_3rc1~192 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=c1b06d26eff3badc8a2da8e3196b89289bdcde21;p=freeside.git legacy agent_custid field should be as searchable as actual custnum, right? at least if it is a number... --- 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 );