X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fxmlhttp-cust_main-search.cgi;h=481bea264f5fc00fd70a486125fc4404378d26b5;hb=38dd3ed3eeda0a467e1b4d8cedd741fc62aedc9c;hp=26e68b5d87d9808581a46517bb4f772304165f2f;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi index 26e68b5d8..481bea264 100644 --- a/httemplate/misc/xmlhttp-cust_main-search.cgi +++ b/httemplate/misc/xmlhttp-cust_main-search.cgi @@ -2,10 +2,10 @@ % % my $custnum = $cgi->param('arg'); % my $cust_main = ''; -% if ( $custnum <= 2147483647 ) { +% if ( $custnum =~ /^(\d+)$/ and $1 <= 2147483647 ) { % $cust_main = qsearchs({ % 'table' => 'cust_main', -% 'hashref' => { 'custnum' => $custnum }, +% 'hashref' => { 'custnum' => $1 }, % 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, % }); % } @@ -22,7 +22,9 @@ % } elsif ( $sub eq 'smart_search' ) { % % my $string = $cgi->param('arg'); -% my @cust_main = smart_search( 'search' => $string ); +% my @cust_main = smart_search( 'search' => $string, +% 'no_fuzzy_on_exact' => 1, #pref? +% ); % my $return = [ map [ $_->custnum, $_->name ], @cust_main ]; % <% objToJson($return) %>