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

This commit is contained in:
Afshan 2020-06-19 12:37:50 +05:30
parent 23cb5e1869
commit 7a45c8bc28

View File

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