fix payment lookup when revoking batch payments, #18548 and #21117
authorMark Wells <mark@freeside.biz>
Wed, 6 Mar 2013 21:04:58 +0000 (13:04 -0800)
committerMark Wells <mark@freeside.biz>
Wed, 6 Mar 2013 21:04:58 +0000 (13:04 -0800)
FS/FS/cust_pay_batch.pm

index 1db74ef..30ddc37 100644 (file)
@@ -343,6 +343,11 @@ sub decline {
       # Void the payment
       my $cust_pay = qsearchs('cust_pay', { 
           custnum  => $new->custnum,
+          batchnum => $new->batchnum
+        });
+      # pre-3.0 style
+      $cust_pay ||= qsearchs('cust_pay', { 
+          custnum  => $new->custnum,
           paybatch => $new->batchnum
         });
       if ( !$cust_pay ) {