summaryrefslogtreecommitdiff
path: root/httemplate/misc/xmlhttp-cust_main-search.cgi
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-04-14 12:02:14 -0700
committerMark Wells <mark@freeside.biz>2012-04-14 12:02:14 -0700
commit5f2f706faad794d87d930c64db8eb641fe61990d (patch)
tree90f08fdbed3305636a3ccb9475e847f43489ca5a /httemplate/misc/xmlhttp-cust_main-search.cgi
parent7150fcff4de104614319b5c57104d55e250dc8c3 (diff)
fix various quick payment entry problems, #17356
Diffstat (limited to 'httemplate/misc/xmlhttp-cust_main-search.cgi')
-rw-r--r--httemplate/misc/xmlhttp-cust_main-search.cgi8
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