From 378bd3dcbe67b0ea00ab65aca2c59ff777137469 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 18 Dec 2007 20:58:25 +0000 Subject: [PATCH] legacy agent_custid field should be as searchable as actual custnum, right? at least if it is a number... --- FS/FS/cust_main.pm | 9 +++++++++ 1 file changed, 9 insertions(+) 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 ); -- 2.11.0