From: ivan Date: Tue, 6 May 2008 01:14:55 +0000 (+0000) Subject: agent-virtualize customer # portion of quick payment entry X-Git-Tag: root_of_webpay_support~666 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5beea6929acac0c1d0270fae961b3da87f6f8cdc agent-virtualize customer # portion of quick payment entry --- diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi index 67512fad9..20707dab8 100644 --- a/httemplate/misc/xmlhttp-cust_main-search.cgi +++ b/httemplate/misc/xmlhttp-cust_main-search.cgi @@ -1,22 +1,24 @@ -% -% my $sub = $cgi->param('sub'); -% -% if ( $sub eq 'custnum_search' ) { +% if ( $sub eq 'custnum_search' ) { % -% my $custnum = $cgi->param('arg'); -% my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); -% +% my $custnum = $cgi->param('arg'); +% my $cust_main = qsearchs({ +% 'table' => 'cust_main', +% 'hashref' => { 'custnum' => $custnum }, +% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, +% }); % "<% $cust_main ? $cust_main->name : '' %>" -% } elsif ( $sub eq 'smart_search' ) { % -% my $string = $cgi->param('arg'); -% my @cust_main = smart_search( 'search' => $string ); -% my $return = [ map [ $_->custnum, $_->name ], @cust_main ]; +% } elsif ( $sub eq 'smart_search' ) { % +% my $string = $cgi->param('arg'); +% my @cust_main = smart_search( 'search' => $string ); +% my $return = [ map [ $_->custnum, $_->name ], @cust_main ]; % <% objToJson($return) %> % } +<%init> +my $sub = $cgi->param('sub'); - +