From 72c359afa2607b8eee739f138a44c8d998bf6590 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 24 Feb 2015 16:05:19 +0530 Subject: [PATCH] valuation type charges can not be inclusive --- erpnext/controllers/accounts_controller.py | 2 ++ erpnext/public/js/controllers/accounts.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index e4869894ad..be49bf5746 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -386,3 +386,5 @@ def validate_inclusive_tax(tax, doc): not all([cint(t.included_in_print_rate) for t in doc.get("taxes")[:cint(tax.row_id) - 1]]): # all rows about the reffered tax should be inclusive _on_previous_row_error("1 - %d" % (tax.row_id,)) + elif tax.category == "Valuation": + frappe.throw(_("Valuation type charges can not marked as Inclusive")) diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js index d0f27bcedf..35d8c6698b 100644 --- a/erpnext/public/js/controllers/accounts.js +++ b/erpnext/public/js/controllers/accounts.js @@ -76,6 +76,8 @@ cur_frm.cscript.validate_inclusive_tax = function(tax) { // all rows above this tax should be inclusive on_previous_row_error(tax.row_id == 1 ? "1" : "1 - " + tax.row_id); } + } else if(tax.category == "Valuation") { + frappe.throw(__("Valuation type charges can not marked as Inclusive")); } } }