diff options
author | Mark Wells <mark@freeside.biz> | 2013-04-05 16:15:56 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-04-05 16:15:56 -0700 |
commit | 6b36f36dbf2cc6ae381827db1f1cdff394a3d334 (patch) | |
tree | fa5c6c7974a62202ca7224a4d879318c5930eb58 /httemplate/misc/xmlhttp-cust_bill-search.html | |
parent | fd67c768f2f59f7883197889ef02bb3e1fb2b0c7 (diff) |
tolerate custnum errors in quick payment entry, #22369
Diffstat (limited to 'httemplate/misc/xmlhttp-cust_bill-search.html')
-rw-r--r-- | httemplate/misc/xmlhttp-cust_bill-search.html | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/httemplate/misc/xmlhttp-cust_bill-search.html b/httemplate/misc/xmlhttp-cust_bill-search.html index 46f15d1ab..459c5db3e 100644 --- a/httemplate/misc/xmlhttp-cust_bill-search.html +++ b/httemplate/misc/xmlhttp-cust_bill-search.html @@ -6,13 +6,15 @@ die 'access denied' unless $curuser->access_right('View invoices'); my @return; if ( $cgi->param('sub') eq 'custnum_search_open' ) { my $custnum = $cgi->param('arg'); - #warn "searching invoices for $custnum\n"; - my $cust_main = FS::cust_main->by_key($custnum); - @return = map { - +{ $_->hash, - 'owed' => $_->owed } - } $cust_main->open_cust_bill - if $curuser->agentnums_href->{ $cust_main->agentnum }; + if ( $custnum =~ /^(\d+)$/ ) { +#warn "searching invoices for $custnum\n"; + my $cust_main = FS::cust_main->by_key($custnum); + @return = map { + +{ $_->hash, + 'owed' => $_->owed } + } $cust_main->open_cust_bill + if $curuser->agentnums_href->{ $cust_main->agentnum }; + } } </%init> |