From b5527a9a213f05a4a9b1242c3c0a0876e2630f31 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Fri, 19 Dec 2014 12:03:51 -0800 Subject: [PATCH] CRM-15409 - UI fixes for Sales Tax implementation. ---------------------------------------- * CRM-15409: https://issues.civicrm.org/jira/browse/CRM-15409 --- CRM/Contribute/Form/Contribution.php | 4 +++- templates/CRM/Contribute/Form/Contribution.tpl | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index bff0b39792..a3df13a05d 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -924,8 +924,10 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP if ($this->_id && isset($this->_values['tax_amount'])) { $componentDetails = CRM_Contribute_BAO_Contribution::getComponentDetails($this->_id); if (CRM_Utils_Array::value('membership', $componentDetails) || CRM_Utils_Array::value('participant', $componentDetails)) { + if ($totalAmount) { + $totalAmount->freeze(); + } $financialType->freeze(); - $totalAmount->freeze(); $this->assign('freezeFinancialType', TRUE); } } diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index 490256c860..14726de44a 100644 --- a/templates/CRM/Contribute/Form/Contribution.tpl +++ b/templates/CRM/Contribute/Form/Contribution.tpl @@ -112,8 +112,8 @@ {if $ppID}{ts}adjust payment amount{/ts}{help id="adjust-payment-amount"}{/if}
-
{ts}Total amount of this contribution.{/ts}{if $hasPriceSets} {ts}Alternatively, you can use a price set.{/ts}{/if} -
+ {if $hasPriceSets}{ts}Alternatively, you can use a price set.{/ts}{/if} +
@@ -635,6 +635,9 @@ CRM.$(function($) { var taxRate = taxRates[financialType]; if (!taxRate) { taxRate = 0; + cj("#totalTaxAmount").hide( ); + } else { + cj("#totalTaxAmount").show( ); } var totalAmount = $('#total_amount').val(); var thousandMarker = '{/literal}{$config->monetaryThousandSeparator}{literal}'; @@ -646,7 +649,7 @@ CRM.$(function($) { var taxAmount = (taxRate/100)*totalAmount; taxAmount = isNaN (taxAmount) ? 0:taxAmount; var totalTaxAmount = taxAmount + Number(totalAmount); - totalTaxAmount = formatMoney( totalTaxAmount, 2, seperator, thousandMarker ); + totalTaxAmount = formatMoney( totalTaxAmount, 2, seperator, thousandMarker ); $("#totalTaxAmount" ).html('Amount with tax : ' + currencySymbol + ' '+ totalTaxAmount); } -- 2.25.1