Skip to content

Commit

Permalink
Merge pull request civicrm#23 from pratikshad/VAT-499
Browse files Browse the repository at this point in the history
Display sales tax amounts on event information page
  • Loading branch information
pradpnayak committed Jul 1, 2014
2 parents 3bf3469 + 4820a42 commit 4423f3b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
12 changes: 10 additions & 2 deletions CRM/Event/Page/EventInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,18 @@ function run() {
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++;
Expand Down
8 changes: 7 additions & 1 deletion templates/CRM/Event/Page/EventInfo.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,13 @@
<tr>
<td class="{$lClass} crm-event-label">{$feeBlock.label.$idx}</td>
{if $isPriceSet & $feeBlock.isDisplayAmount.$idx}
<td class="fee_amount-value right">{$feeBlock.value.$idx|crmMoney}</td>
<td class="fee_amount-value right">
{if $feeBlock.tax_amount.$idx}
{$feeBlock.value.$idx}
{else}
{$feeBlock.value.$idx|crmMoney}
{/if}
</td>
{/if}
</tr>
{/if}
Expand Down

0 comments on commit 4423f3b

Please sign in to comment.