fix: dont recompute item wise taxes from front end

(cherry picked from commit 393749a611)
This commit is contained in:
Ankush Menat
2021-10-19 14:05:44 +05:30
committed by Ankush Menat
parent 34e92ab229
commit 8fffd1597d

View File

@@ -137,7 +137,9 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
var me = this; var me = this;
$.each(this.frm.doc["taxes"] || [], function(i, tax) { $.each(this.frm.doc["taxes"] || [], function(i, tax) {
tax.item_wise_tax_detail = {}; if (!tax.dont_recompute_tax) {
tax.item_wise_tax_detail = {};
}
var tax_fields = ["total", "tax_amount_after_discount_amount", var tax_fields = ["total", "tax_amount_after_discount_amount",
"tax_amount_for_current_item", "grand_total_for_current_item", "tax_amount_for_current_item", "grand_total_for_current_item",
"tax_fraction_for_current_item", "grand_total_fraction_for_current_item"]; "tax_fraction_for_current_item", "grand_total_fraction_for_current_item"];
@@ -419,7 +421,9 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
current_tax_amount = tax_rate * item.qty; current_tax_amount = tax_rate * item.qty;
} }
this.set_item_wise_tax(item, tax, tax_rate, current_tax_amount); if (!tax.dont_recompute_tax) {
this.set_item_wise_tax(item, tax, tax_rate, current_tax_amount);
}
return current_tax_amount; return current_tax_amount;
}, },
@@ -587,7 +591,9 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
delete tax[fieldname]; delete tax[fieldname];
}); });
tax.item_wise_tax_detail = JSON.stringify(tax.item_wise_tax_detail); if (!tax.dont_recompute_tax) {
tax.item_wise_tax_detail = JSON.stringify(tax.item_wise_tax_detail);
}
}); });
} }
}, },