From fe7983e7980b971031b3813349c79e66863ace57 Mon Sep 17 00:00:00 2001 From: Pratiksha Dubey Date: Thu, 24 Jul 2014 18:03:01 +0530 Subject: [PATCH 1/1] Display sales tax amounts on event information page --- CRM/Event/Page/EventInfo.php | 10 ++++++---- templates/CRM/Event/Page/EventInfo.tpl | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CRM/Event/Page/EventInfo.php b/CRM/Event/Page/EventInfo.php index 7a57c3aca3..d34e2ab189 100644 --- a/CRM/Event/Page/EventInfo.php +++ b/CRM/Event/Page/EventInfo.php @@ -145,12 +145,14 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { $labelClass = 'price_set_field-label'; } // show tax rate with amount - $displayOpt = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings'); - $displayOpt = CRM_Utils_Array::value('tax_display_settings', $displayOpt); + $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings'); + $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings); + $displayOpt = CRM_Utils_Array::value('tax_display_settings', $invoiceSettings); + $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings); foreach ($fieldValues['options'] as $optionId => $optionVal) { $values['feeBlock']['isDisplayAmount'][$fieldCnt] = CRM_Utils_Array::value('is_display_amounts', $fieldValues); - if (CRM_Utils_Array::value('tax_amount', $optionVal)) { - $values['feeBlock']['value'][$fieldCnt] = CRM_Price_BAO_PriceField::getTaxLabel($optionVal,'amount',$displayOpt); + if ($invoicing && isset($optionVal['tax_amount'])) { + $values['feeBlock']['value'][$fieldCnt] = CRM_Price_BAO_PriceField::getTaxLabel($optionVal, 'amount', $displayOpt, $taxTerm); $values['feeBlock']['tax_amount'][$fieldCnt] = $optionVal['tax_amount']; } else { diff --git a/templates/CRM/Event/Page/EventInfo.tpl b/templates/CRM/Event/Page/EventInfo.tpl index 91ed2208dc..7b7684b54c 100644 --- a/templates/CRM/Event/Page/EventInfo.tpl +++ b/templates/CRM/Event/Page/EventInfo.tpl @@ -217,7 +217,7 @@ {$feeBlock.label.$idx} {if $isPriceSet & $feeBlock.isDisplayAmount.$idx} - {if $feeBlock.tax_amount.$idx} + {if isset($feeBlock.tax_amount.$idx)} {$feeBlock.value.$idx} {else} {$feeBlock.value.$idx|crmMoney} -- 2.25.1