Fix for non-allocation of payment to fully reversed checkboxes option
authoreileen <emcnaughton@wikimedia.org>
Wed, 6 Nov 2019 04:51:20 +0000 (17:51 +1300)
committereileen <emcnaughton@wikimedia.org>
Wed, 6 Nov 2019 04:51:20 +0000 (17:51 +1300)
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

index ef6de745f306caf62b9bc52cf629850cded91a06..a76426354f1504d70b52b680504eae3bf17e8443 100644 (file)
@@ -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 = [