discount related fix
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index 2d5df15..c846dd0 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -73,8 +73,9 @@
def initialize_taxes(self):
for tax in self.doc.get("taxes"):
- validate_taxes_and_charges(tax)
- validate_inclusive_tax(tax, self.doc)
+ if not self.discount_amount_applied:
+ validate_taxes_and_charges(tax)
+ validate_inclusive_tax(tax, self.doc)
tax.item_wise_tax_detail = {}
tax_fields = ["total", "tax_amount_after_discount_amount",
diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js
index d07c917..9c321cc 100644
--- a/erpnext/public/js/controllers/taxes_and_totals.js
+++ b/erpnext/public/js/controllers/taxes_and_totals.js
@@ -94,8 +94,10 @@
$.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0 });
- cur_frm.cscript.validate_taxes_and_charges(tax.doctype, tax.name);
- me.validate_inclusive_tax(tax);
+ if (!this.discount_amount_applied) {
+ cur_frm.cscript.validate_taxes_and_charges(tax.doctype, tax.name);
+ me.validate_inclusive_tax(tax);
+ }
frappe.model.round_floats_in(tax);
});
},