From a66daaa80d49c0f1a0e81764fa8d94555de888b8 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 10 Nov 2023 19:23:48 +1300 Subject: [PATCH] Fix rc-unreleased regression - tax amount not loading --- CRM/Price/BAO/PriceSet.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 45fab04fa2..566ef3287a 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -801,9 +801,12 @@ WHERE id = %1"; ->addWhere('price_field_id', 'IN', array_keys($data['fields'])) ->setSelect($select) ->execute(); + $taxRates = CRM_Core_PseudoConstant::getTaxRates(); foreach ($options as $option) { // Add in visibility because Smarty templates expect it and it is hard to adjust them to colon format. $option['visibility'] = $option['visibility_id:name']; + $option['tax_rate'] = (float) ($taxRates[$option['financial_type_id']] ?? 0); + $option['tax_amount'] = (float) ($option['tax_rate'] ? CRM_Contribute_BAO_Contribution_Utils::calculateTaxAmount($option['amount'], $option['tax_rate'])['tax_amount'] : 0); $data['fields'][$option['price_field_id']]['options'][$option['id']] = $option; } $cache->set($cacheKey, $data); -- 2.25.1