fix various quick payment entry problems, #17356
[freeside.git] / httemplate / misc / process / batch-cust_pay.cgi
index e51b9e6..a6b90ea 100644 (file)
@@ -19,7 +19,7 @@
 %        '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 {