From: ivan Date: Tue, 18 Dec 2007 20:58:25 +0000 (+0000) Subject: legacy agent_custid field should be as searchable as actual custnum, right? at least... X-Git-Tag: TRIXBOX_2_6~160 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=378bd3dcbe67b0ea00ab65aca2c59ff777137469;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 b5e689233..952aa73c2 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -5289,6 +5289,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', @@ -5296,6 +5299,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 );