From 5beea6929acac0c1d0270fae961b3da87f6f8cdc Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 6 May 2008 01:14:55 +0000 Subject: [PATCH] agent-virtualize customer # portion of quick payment entry --- httemplate/misc/xmlhttp-cust_main-search.cgi | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) 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'); - + -- 2.11.0