From 45d45f4247c8ecc225939d3b3cb7b5b179daa4e2 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 27 Sep 2017 11:49:13 +0530 Subject: [PATCH] [hotfix] Wrong calculation of total in taxes and totals (#10924) --- erpnext/public/js/controllers/taxes_and_totals.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index 12ab7326769..84624b89973 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -288,8 +288,11 @@ erpnext.taxes_and_totals = erpnext.payments.extend({ }, set_cumulative_total: function(row_idx, tax) { - var tax_amount = (in_list(["Valuation and Total", "Total"], tax.category) ? - tax.tax_amount_after_discount_amount : 0); + var tax_amount = tax.tax_amount_after_discount_amount; + if (tax.category == 'Valuation') { + tax_amount = 0; + } + if (tax.add_deduct_tax == "Deduct") { tax_amount = -1*tax_amount; } if(row_idx==0) {