X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fcust_pay_batch.pm;h=e1e32d3d422968adee3ad04b64ba3030a61b63cb;hb=72891d1753adf47e0318049c19a501c89c24f0cd;hp=4138436a7f168865ba8aaef2b6efea8dcb4e7e5b;hpb=61097b876e692dbf5571a17b9aa415949607085f;p=freeside.git 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 ) {