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
diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js
index dbe48ec..a6eb901 100644
--- a/erpnext/public/js/controllers/taxes_and_totals.js
+++ b/erpnext/public/js/controllers/taxes_and_totals.js
@@ -345,11 +345,11 @@
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);