discount related fix

This commit is contained in:
Nabin Hait 2015-02-28 19:11:51 +05:30
parent bc6c360bf1
commit 86cd4cc739
2 changed files with 7 additions and 4 deletions

View File

@ -73,8 +73,9 @@ class calculate_taxes_and_totals(object):
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",

View File

@ -94,8 +94,10 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
$.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);
});
},