From e189cf22f3750ccd3317f02438951b2a2cb1b0f7 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Fri, 30 Oct 2015 19:48:42 +0530 Subject: [PATCH] additional notices on enabling tax invoice --- CRM/Event/Form/Registration/Confirm.php | 8 ++--- CRM/Event/Form/Registration/ThankYou.php | 43 ++++++++++-------------- 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 65a77813fc..5320083f64 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -749,10 +749,10 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $totalTaxAmount = 0; $dataArray = array(); foreach ($this->_lineItem as $key => $value) { - if (($value != 'skip') && - ($entityId = CRM_Utils_Array::value($key, $allParticipantIds)) - ) { - + if ($value == 'skip') { + continue; + } + if ($entityId = CRM_Utils_Array::value($key, $allParticipantIds)) { // do cleanup line items if participant re-walking wizard. if ($this->_allowConfirmation) { CRM_Price_BAO_LineItem::deleteLineItems($entityId, $entityTable); diff --git a/CRM/Event/Form/Registration/ThankYou.php b/CRM/Event/Form/Registration/ThankYou.php index f99c458632..f614b31e0e 100644 --- a/CRM/Event/Form/Registration/ThankYou.php +++ b/CRM/Event/Form/Registration/ThankYou.php @@ -101,38 +101,29 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings); $getTaxDetails = FALSE; $taxAmount = 0; - if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) { - $lineItemForTemplate = array(); - 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_amount']) || isset($v['tax_rate'])) { - $taxAmount += $v['tax_amount']; - $getTaxDetails = TRUE; - } + + $lineItemForTemplate = array(); + if (!empty($this->_lineItem) && is_array($this->_lineItem)) { + foreach ($this->_lineItem as $key => $value) { + if (!empty($value) && $value != 'skip') { + $lineItemForTemplate[$key] = $value; + if ($invoicing) { + foreach ($value as $v) { + if (isset($v['tax_amount']) || isset($v['tax_rate'])) { + $taxAmount += $v['tax_amount']; + $getTaxDetails = TRUE; } } } } } - if (!empty($lineItemForTemplate)) { - $this->assign('lineItem', $lineItemForTemplate); - } } - else { - if ($invoicing) { - foreach ($this->_lineItem as $lineItemKey => $lineItemValue) { - foreach ($lineItemValue as $v) { - if (isset($v['tax_amount']) || isset($v['tax_rate'])) { - $taxAmount += $v['tax_amount']; - $getTaxDetails = TRUE; - } - } - } - } + + if ($this->_priceSetId && + !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config') && + !empty($lineItemForTemplate) + ) { + $this->assign('lineItem', $lineItemForTemplate); } if ($invoicing) { -- 2.25.1