From 6b36f36dbf2cc6ae381827db1f1cdff394a3d334 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Fri, 5 Apr 2013 16:15:56 -0700 Subject: tolerate custnum errors in quick payment entry, #22369 --- httemplate/misc/xmlhttp-cust_bill-search.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'httemplate/misc/xmlhttp-cust_bill-search.html') 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 }; + } } -- cgit v1.2.1