From 9ab9e3293274cdba0ddbd2df21adb575f8b987ef Mon Sep 17 00:00:00 2001 From: levinse Date: Tue, 15 Feb 2011 04:20:21 +0000 Subject: quick payment tool improvements, RT10698 --- httemplate/misc/xmlhttp-cust_main-search.cgi | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi index 481bea264..c71953ba9 100644 --- a/httemplate/misc/xmlhttp-cust_main-search.cgi +++ b/httemplate/misc/xmlhttp-cust_main-search.cgi @@ -25,9 +25,23 @@ % my @cust_main = smart_search( 'search' => $string, % 'no_fuzzy_on_exact' => 1, #pref? % ); -% my $return = [ map [ $_->custnum, $_->name ], @cust_main ]; +% my $return = [ map [ $_->custnum, $_->name, $_->balance ], @cust_main ]; % <% objToJson($return) %> +% } elsif ( $sub eq 'invnum_search' ) { +% +% my $string = $cgi->param('arg'); +% my $inv = qsearchs('cust_bill', { 'invnum' => $string }); +% my $return = []; +% if ( $inv ) { +% my $cust_main = qsearchs({ +% 'table' => 'cust_main', +% 'hashref' => { 'custnum' => $inv->custnum }, +% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, +% }); +% $return = [ $cust_main->custnum, $cust_main->name, $cust_main->balance ]; +% } +<% objToJson($return) %> % } <%init> -- cgit v1.2.1