diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 5acff51c3ac..3f1bdcd5020 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -34,6 +34,7 @@ * This class generates form components for processing Event. */ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { + use CRM_Financial_Form_FrontEndPaymentFormTrait; /** * The values for the contribution db object. @@ -297,25 +298,16 @@ public function buildQuickForm() { if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) { $lineItemForTemplate = []; - $getTaxDetails = FALSE; if (!empty($this->_lineItem) && is_array($this->_lineItem)) { foreach ($this->_lineItem as $key => $value) { if (!empty($value)) { $lineItemForTemplate[$key] = $value; } - if ($invoicing) { - foreach ($value as $v) { - if (isset($v['tax_rate'])) { - $getTaxDetails = TRUE; - } - } - } } } if (!empty($lineItemForTemplate)) { - $this->assign('lineItem', $lineItemForTemplate); + $this->assignLineItemsToTemplate($lineItemForTemplate); } - $this->assign('getTaxDetails', $getTaxDetails); } //display additional participants profile. diff --git a/CRM/Event/Form/Registration/ThankYou.php b/CRM/Event/Form/Registration/ThankYou.php index 7c13ada6f6a..00a1d89afa3 100644 --- a/CRM/Event/Form/Registration/ThankYou.php +++ b/CRM/Event/Form/Registration/ThankYou.php @@ -39,6 +39,7 @@ * */ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { + use CRM_Financial_Form_FrontEndPaymentFormTrait; /** * Set variables up before form is built. @@ -97,7 +98,6 @@ public function buildQuickForm() { $this->assignToTemplate(); $invoicing = CRM_Invoicing_Utils::isInvoicingEnabled(); - $getTaxDetails = FALSE; $taxAmount = 0; $lineItemForTemplate = []; @@ -109,7 +109,6 @@ public function buildQuickForm() { foreach ($value as $v) { if (isset($v['tax_amount']) || isset($v['tax_rate'])) { $taxAmount += $v['tax_amount']; - $getTaxDetails = TRUE; } } } @@ -121,13 +120,11 @@ public function buildQuickForm() { !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config') && !empty($lineItemForTemplate) ) { - $this->assign('lineItem', $lineItemForTemplate); + $this->assignLineItemsToTemplate($lineItemForTemplate); } if ($invoicing) { - $this->assign('getTaxDetails', $getTaxDetails); $this->assign('totalTaxAmount', $taxAmount); - $this->assign('taxTerm', CRM_Invoicing_Utils::getTaxTerm()); } $this->assign('totalAmount', $this->_totalAmount);