From 2e131e26d42ddb8623643e474f460f9c521d112d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 2 Sep 2013 18:07:53 +0530 Subject: [PATCH] [fix] [minor] Taxes and charges added/deducted only if category in "Valuation and Total" or "Total" --- buying/doctype/purchase_common/purchase_common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buying/doctype/purchase_common/purchase_common.js b/buying/doctype/purchase_common/purchase_common.js index 67ba33c245..5785b1a9d5 100644 --- a/buying/doctype/purchase_common/purchase_common.js +++ b/buying/doctype/purchase_common/purchase_common.js @@ -333,10 +333,10 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ // other charges added/deducted if(tax_count) { this.frm.doc.other_charges_added = wn.utils.sum($.map(this.frm.tax_doclist, - function(tax) { return tax.add_deduct_tax == "Add" ? tax.tax_amount : 0.0; })); + function(tax) { return (tax.add_deduct_tax == "Add" && in_list(["Valuation and Total", "Total"], tax.category)) ? tax.tax_amount : 0.0; })); this.frm.doc.other_charges_deducted = wn.utils.sum($.map(this.frm.tax_doclist, - function(tax) { return tax.add_deduct_tax == "Deduct" ? tax.tax_amount : 0.0; })); + function(tax) { return (tax.add_deduct_tax == "Deduct" && in_list(["Valuation and Total", "Total"], tax.category)) ? tax.tax_amount : 0.0; })); wn.model.round_floats_in(this.frm.doc, ["other_charges_added", "other_charges_deducted"]);