From 3a669c96212c30288f4b4c13bf7b123c7cc3c538 Mon Sep 17 00:00:00 2001 From: pratikshad Date: Fri, 27 Jun 2014 19:29:55 +0530 Subject: [PATCH] Display sales tax amounts on event information page --- CRM/Event/Page/EventInfo.php | 12 ++++++++++-- templates/CRM/Event/Page/EventInfo.tpl | 6 +++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CRM/Event/Page/EventInfo.php b/CRM/Event/Page/EventInfo.php index 1e9723564e..7a57c3aca3 100644 --- a/CRM/Event/Page/EventInfo.php +++ b/CRM/Event/Page/EventInfo.php @@ -144,10 +144,18 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { else { $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); foreach ($fieldValues['options'] as $optionId => $optionVal) { $values['feeBlock']['isDisplayAmount'][$fieldCnt] = CRM_Utils_Array::value('is_display_amounts', $fieldValues); - $values['feeBlock']['value'][$fieldCnt] = $optionVal['amount']; + if (CRM_Utils_Array::value('tax_amount', $optionVal)) { + $values['feeBlock']['value'][$fieldCnt] = CRM_Price_BAO_PriceField::getTaxLabel($optionVal,'amount',$displayOpt); + $values['feeBlock']['tax_amount'][$fieldCnt] = $optionVal['tax_amount']; + } + else { + $values['feeBlock']['value'][$fieldCnt] = $optionVal['amount']; + } $values['feeBlock']['label'][$fieldCnt] = $optionVal['label']; $values['feeBlock']['lClass'][$fieldCnt] = $labelClass; $fieldCnt++; diff --git a/templates/CRM/Event/Page/EventInfo.tpl b/templates/CRM/Event/Page/EventInfo.tpl index 2e2a77082f..12b928edef 100644 --- a/templates/CRM/Event/Page/EventInfo.tpl +++ b/templates/CRM/Event/Page/EventInfo.tpl @@ -216,7 +216,11 @@ {$feeBlock.label.$idx} {if $isPriceSet & $feeBlock.isDisplayAmount.$idx} - {$feeBlock.value.$idx|crmMoney} + {if $feeBlock.tax_amount.$idx} + {$feeBlock.value.$idx} + {else} + {$feeBlock.value.$idx|crmMoney} + {/if} {/if} {/if} -- 2.25.1