select quick payment entry batch in payment report, RT#26343
[freeside.git] / httemplate / search / elements / cust_pay_or_refund.html
index 234121f..c272a16 100755 (executable)
@@ -440,8 +440,6 @@ if ( $cgi->param('magic') ) {
     $cgi->param('paybatch') =~ /^([\w\/\:\-\.]+)$/
       or die "illegal paybatch: ". $cgi->param('paybatch');
 
-    push @search, "paybatch = '$1'";
-
     $orderby = "LOWER(company || ' ' || last || ' ' || first )";
 
   } elsif ( $cgi->param('magic') eq 'batchnum' ) {
@@ -457,6 +455,10 @@ if ( $cgi->param('magic') ) {
     die "unknown search magic: ". $cgi->param('magic');
   }
 
+  if ( $cgi->param('paybatch') =~ /^([\w\/\:\-\.]+)$/ ) {
+    push @search, "paybatch = '$1'";
+  }
+
   #unapplied payment/refund
   if ( $unapplied ) {
     push @select, '(' . "FS::$table"->unapplied_sql . ') AS unapplied_amount';