From 99cdcf5769f53b23231107a5701306b5691688f4 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 26 Mar 2022 11:13:45 +1300 Subject: [PATCH] Assign totalTaxAmount more consistently --- CRM/Event/Form/Participant.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 61ee14ca04..59ccd6772a 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1659,8 +1659,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment CRM_Event_Form_Registration::initEventFee($form, $event['id'], FALSE); CRM_Event_Form_Registration_Register::buildAmount($form, TRUE, $form->_discountId); $lineItem = []; - $invoiceSettings = Civi::settings()->get('contribution_invoice_settings'); - $invoicing = $invoiceSettings['invoicing'] ?? NULL; $totalTaxAmount = 0; if (!CRM_Utils_System::isNull(CRM_Utils_Array::value('line_items', $form->_values))) { $lineItem[] = $form->_values['line_items']; @@ -1668,9 +1666,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $totalTaxAmount = $value['tax_amount'] + $totalTaxAmount; } } - if ($invoicing) { - $form->assign('totalTaxAmount', $totalTaxAmount); - } + $form->assign('totalTaxAmount', Civi::settings()->get('invoicing') ? ($totalTaxAmount ?? NULL) : NULL); $form->assign('lineItem', empty($lineItem) ? FALSE : $lineItem); $discounts = []; if (!empty($form->_values['discount'])) { -- 2.25.1