diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-04-15 15:38:47 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-04-15 15:38:47 -0700 |
commit | 820fe0ac288d4f2bb975b7f58ee02baefd96ed24 (patch) | |
tree | 0661dd62e4c4c9e71dca45aedc473cbb7aeb35f4 /httemplate/misc/xmlhttp-cust_main-search.cgi | |
parent | 2ce6ee8e5cd817a4018ad26eb1e364198c1dd931 (diff) | |
parent | 401ba3ab0637de1bc460370949b75dca092375d8 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/misc/xmlhttp-cust_main-search.cgi')
-rw-r--r-- | httemplate/misc/xmlhttp-cust_main-search.cgi | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi index 68c5bf597..436501e8b 100644 --- a/httemplate/misc/xmlhttp-cust_main-search.cgi +++ b/httemplate/misc/xmlhttp-cust_main-search.cgi @@ -18,9 +18,13 @@ % } elsif ( $sub eq 'invnum_search' ) { % % my $string = $cgi->param('arg'); -% my $inv = qsearchs('cust_bill', { 'invnum' => $string }); -% my $return = $inv ? findbycustnum($inv->custnum,0) : []; +% if ( $string =~ /^(\d+)$/ ) { +% my $inv = qsearchs('cust_bill', { 'invnum' => $1 }); +% my $return = $inv ? findbycustnum($inv->custnum,0) : []; <% objToJson($return) %> +% } else { #return nothing +[] +% } % } % elsif ( $sub eq 'exact_search' ) { % # XXX possibly should query each element separately |