From 7a45c8bc28b286e73c349d82a268758b2c0f75f5 Mon Sep 17 00:00:00 2001 From: Afshan Date: Fri, 19 Jun 2020 12:37:50 +0530 Subject: [PATCH] fix: replaced "row_id" to "idx" as "row_id" was not available in variable "tax", also replaced "-1" by "-2" as "idx" starts with 0 rather than 1 --- erpnext/public/js/controllers/taxes_and_totals.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index dbe48ec6544..a6eb901fa72 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -345,11 +345,11 @@ erpnext.taxes_and_totals = erpnext.payments.extend({ current_tax_amount = (tax_rate / 100.0) * item.net_amount; } else if(tax.charge_type == "On Previous Row Amount") { current_tax_amount = (tax_rate / 100.0) * - this.frm.doc["taxes"][cint(tax.row_id) - 1].tax_amount_for_current_item; + this.frm.doc["taxes"][cint(tax.idx) - 2].tax_amount_for_current_item; } else if(tax.charge_type == "On Previous Row Total") { current_tax_amount = (tax_rate / 100.0) * - this.frm.doc["taxes"][cint(tax.row_id) - 1].grand_total_for_current_item; + this.frm.doc["taxes"][cint(tax.idx) - 2].grand_total_for_current_item; } this.set_item_wise_tax(item, tax, tax_rate, current_tax_amount);