diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index 7b5a87b91b4d..3859d1eab6e0 100644 --- a/templates/CRM/Contribute/Form/Contribution.tpl +++ b/templates/CRM/Contribute/Form/Contribution.tpl @@ -632,14 +632,12 @@ if(event.handled !== true) { var financialType = cj('#financial_type_id').val(); var taxRates = '{/literal}{$taxRates}{literal}'; var taxRates = JSON.parse(taxRates); - var taxRate = taxRates[financialType]; + var taxRate = taxRates[financialType]; + if (!taxRate) { + taxRate = 0; + } var totalAmount = cj('#total_amount').val(); - if (taxRate) { - var totalTaxAmount = Number((taxRate/100)*totalAmount)+Number(totalAmount); - } - else { - totalTaxAmount = totalAmount ; - } + var totalTaxAmount = Number((taxRate/100)*totalAmount)+Number(totalAmount); cj( "#totalTaxAmount" ).html('Total Amount : '+totalTaxAmount); event.handled = true; }