diff options
author | ivan <ivan> | 2008-05-06 01:14:55 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-05-06 01:14:55 +0000 |
commit | 5beea6929acac0c1d0270fae961b3da87f6f8cdc (patch) | |
tree | 5515da5e8ca10df4b088f76f0351bb041be0ed69 | |
parent | 1b19010429786e0a2987573dc9dbff351091911e (diff) |
agent-virtualize customer # portion of quick payment entry
-rw-r--r-- | httemplate/misc/xmlhttp-cust_main-search.cgi | 26 |
1 files 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'); - +</%init> |