From 32ecba8e5830619359c7ceb1db807acdec8cac8d Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 6 Nov 2019 17:51:20 +1300 Subject: [PATCH] Fix for non-allocation of payment to fully reversed checkboxes option This addresses an issue partially identified in https://lab.civicrm.org/dev/financial/issues/98 whereby civicrm_entity_financial_trxn records for the civicrm_financial_item table are not created when refunding against line items with a quantity of zero - ie where there were selected checkboxes & they were reversed. The reason this check was there relates to former logic - now we have a calculated allocation we don't need this check. I want to do a test but need to do a bit of work to get it set up & I think this should hit 5.20 as it relates to an issue identified by Kevin in reviewing patches merged to that version --- CRM/Financial/BAO/Payment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Financial/BAO/Payment.php b/CRM/Financial/BAO/Payment.php index ef6de745f3..a76426354f 100644 --- a/CRM/Financial/BAO/Payment.php +++ b/CRM/Financial/BAO/Payment.php @@ -102,7 +102,7 @@ class CRM_Financial_BAO_Payment { list($ftIds, $taxItems) = CRM_Contribute_BAO_Contribution::getLastFinancialItemIds($params['contribution_id']); foreach ($lineItems as $key => $value) { - if ($value['qty'] == 0 || $value['allocation'] === (float) 0) { + if ($value['allocation'] === (float) 0) { continue; } $eftParams = [ -- 2.25.1