blob: 20707dab895e3b4caf4d7dad3b56bbc6257f432a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
% if ( $sub eq 'custnum_search' ) {
%
% 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 ];
%
<% objToJson($return) %>
% }
<%init>
my $sub = $cgi->param('sub');
</%init>
|