% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
% });
% }
-% if ( !$cust_main ) { # not found, try agent_custid
+% if ( length($custnum) and !$cust_main ) { # not found, try agent_custid
% $cust_main = qsearchs({
% 'table' => 'cust_main',
% 'hashref' => { 'agent_custid' => $custnum },
%
% my $erow=0;
% $cgi->param('error'. $erow++, shift @errors) while @errors;
-%
%
-<% $cgi->redirect($p.'batch-cust_pay.html?'. $cgi->query_string)
+% my $query = $m->scomp('/elements/create_uri_query');
+%
+<% $cgi->redirect($p."batch-cust_pay.html?$query")
%>
% } else {