X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fxmlhttp-cust_main-search.cgi;h=c71953ba9307bff35203356b30f6e117050c523f;hp=481bea264f5fc00fd70a486125fc4404378d26b5;hb=9ab9e3293274cdba0ddbd2df21adb575f8b987ef;hpb=e2e281e075e2932b61b57541c694e1af75b7d304 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>