X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fxmlhttp-cust_main-search.cgi;h=b3bf4681be856b33a2a0affb3e685b58b7787364;hb=907490c7389d24aa33f3facb8a492735050a0932;hp=16f7cd2bc1e5e7270074bc68542995408871b5ed;hpb=f3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7;p=freeside.git diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi index 16f7cd2bc..b3bf4681b 100644 --- a/httemplate/misc/xmlhttp-cust_main-search.cgi +++ b/httemplate/misc/xmlhttp-cust_main-search.cgi @@ -5,31 +5,32 @@ % # cust_main-agent_custid-format') eq 'ww?d+' % $return = findbycustnum_or_agent_custid($1); % } -<% objToJson($return) %> +<% encode_json($return) %>\ % } elsif ( $sub eq 'smart_search' ) { % % my $string = $cgi->param('arg'); % my @cust_main = smart_search( 'search' => $string, -% 'no_fuzzy_on_exact' => 1, #pref? +% 'no_fuzzy_on_exact' => ! $FS::CurrentUser::CurrentUser->option('enable_fuzzy_on_exact'), % ); % my $return = [ map [ $_->custnum, % $_->name, % $_->balance, % $_->ucfirst_status, % $_->statuscolor, -% scalar($_->open_cust_bill) +% scalar($_->open_cust_bill), +% $_->display_custnum, % ], % @cust_main % ]; % -<% objToJson($return) %> +<% encode_json($return) %>\ % } elsif ( $sub eq 'invnum_search' ) { % % my $string = $cgi->param('arg'); % if ( $string =~ /^(\d+)$/ ) { % my $inv = qsearchs('cust_bill', { 'invnum' => $1 }); % my $return = $inv ? findbycustnum($inv->custnum) : []; -<% objToJson($return) %> +<% encode_json($return) %>\ % } else { #return nothing [] % } @@ -47,7 +48,7 @@ % city => $_->city, % }; % } -<% objToJson($return) %> +<% encode_json($return) %>\ % } <%init> @@ -66,7 +67,8 @@ sub findbycustnum { $c->balance, $c->ucfirst_status, $c->statuscolor, - scalar($c->open_cust_bill) + scalar($c->open_cust_bill), + $c->display_custnum, ]; } @@ -94,6 +96,7 @@ sub findbycustnum_or_agent_custid { $_->ucfirst_status, $_->statuscolor, scalar($_->open_cust_bill), + $_->display_custnum, ], qsearch({