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);