Skip to content

Commit

Permalink
Merge pull request civicrm#36 from pratikshad/VAT-499-newpush
Browse files Browse the repository at this point in the history
Display sales tax amounts on event information page
  • Loading branch information
pradpnayak committed Aug 6, 2014
2 parents d78a967 + 9265ab2 commit e1d251e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions CRM/Event/Page/EventInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,14 @@ function run() {
$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 {
Expand Down
4 changes: 2 additions & 2 deletions templates/CRM/Event/Page/EventInfo.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@
<td class="{$lClass} crm-event-label">{$feeBlock.label.$idx}</td>
{if $isPriceSet & $feeBlock.isDisplayAmount.$idx}
<td class="fee_amount-value right">
{if $feeBlock.tax_amount.$idx}
{$feeBlock.value.$idx}
{if isset($feeBlock.tax_amount.$idx)}
{$feeBlock.value.$idx}
{else}
{$feeBlock.value.$idx|crmMoney}
{/if}
Expand Down

0 comments on commit e1d251e

Please sign in to comment.