Skip to content

Commit

Permalink
Optimization of code
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikshad committed Jul 2, 2014
1 parent a1e457f commit 98b1964
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions templates/CRM/Contribute/Form/Contribution.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 98b1964

Please sign in to comment.