From 5574cc1ce62321169e89b77f9846ace18ea74ab6 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Sat, 29 Aug 2020 00:55:38 +0100 Subject: [PATCH 1/2] Fix to tax calculation on Contribution page --- CRM/Price/BAO/PriceSet.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index bc87b6e9fe53..6171ebd9e57b 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -673,7 +673,7 @@ public static function processAmount($fields, &$params, &$lineItem, $priceSetID continue; } - list($params, $lineItem, $totalTax, $totalPrice) = self::getLine($params, $lineItem, $priceSetID, $field, $id, $totalPrice); + list($params, $lineItem, $totalTax, $totalPrice) = self::getLine($params, $lineItem, $priceSetID, $field, $id, $totalPrice, $totalTax); } $amount_level = []; @@ -1692,8 +1692,7 @@ protected static function reformatUsedByFormsWithEntityData($forms) { * * @return array */ - public static function getLine(&$params, &$lineItem, $priceSetID, $field, $id, $totalPrice): array { - $totalTax = 0; + public static function getLine(&$params, &$lineItem, $priceSetID, $field, $id, $totalPrice, &$totalTax = 0): array { switch ($field['html_type']) { case 'Text': $firstOption = reset($field['options']); From 8628cc3410159aacf6ef2e73b9798c5d9b8d2127 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Sat, 29 Aug 2020 01:01:51 +0100 Subject: [PATCH 2/2] Added defination --- CRM/Price/BAO/PriceSet.php | 1 + 1 file changed, 1 insertion(+) diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 6171ebd9e57b..8b7444606939 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -1689,6 +1689,7 @@ protected static function reformatUsedByFormsWithEntityData($forms) { * @param array $field * @param int $id * @param float $totalPrice + * @param float $totalTax * * @return array */