From: Mark Wells Date: Wed, 6 Mar 2013 20:16:21 +0000 (-0800) Subject: fix payment lookup when revoking batch payments, #18458 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5fe75497ce60689c128d93a3f1c9339e7c5e4e49 fix payment lookup when revoking batch payments, #18458 --- diff --git a/FS/FS/cust_pay_batch.pm b/FS/FS/cust_pay_batch.pm index 4138436a7..e1e32d3d4 100644 --- a/FS/FS/cust_pay_batch.pm +++ b/FS/FS/cust_pay_batch.pm @@ -369,6 +369,12 @@ sub decline { # Void the payment my $cust_pay = qsearchs('cust_pay', { custnum => $new->custnum, + batchnum => $new->batchnum + }); + # these should all be migrated over, but if it's not found, look for + # batchnum in the 'paybatch' field also + $cust_pay ||= qsearchs('cust_pay', { + custnum => $new->custnum, paybatch => $new->batchnum }); if ( !$cust_pay ) {