X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fxmlhttp-cust_main-search.cgi;fp=httemplate%2Fmisc%2Fxmlhttp-cust_main-search.cgi;h=8dbd5a4f20d98c53e5c858d0201be7716f1d710f;hb=550685eff557af23e242c545d6a9e27a7ef44f23;hp=0000000000000000000000000000000000000000;hpb=cf8f8aafc5595b31f24a7b0d06289c830d123cb8;p=freeside.git diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi new file mode 100644 index 000000000..8dbd5a4f2 --- /dev/null +++ b/httemplate/misc/xmlhttp-cust_main-search.cgi @@ -0,0 +1,21 @@ +<% + my $sub = $cgi->param('sub'); + + if ( $sub eq 'custnum_search' ) { + + my $custnum = $cgi->param('arg'); + my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); + + %>"<%= $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) %> + +<% } %> + +