diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 22ad66d571b1ea8d2e8064ebbf2b8a1e6b9abeaa..7080424ed6af1a4adb5e20f3522e20249de8edd2 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -98,6 +98,7 @@ class calculate_taxes_and_totals(object): item_doc = frappe.get_cached_doc("Item", item.item_code) args = { "net_rate": item.net_rate or item.rate, + "base_net_rate": item.base_net_rate or item.base_rate, "tax_category": self.doc.get("tax_category"), "posting_date": self.doc.get("posting_date"), "bill_date": self.doc.get("bill_date"), diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 75c7216918d5d1396fc2b0c66471685a66ba8a56..8021471e3578a6ada7ac098e6b87bf31aeb4eadd 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -519,6 +519,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe project: item.project || me.frm.doc.project, qty: item.qty || 1, net_rate: item.rate, + base_net_rate: item.base_net_rate, stock_qty: item.stock_qty, conversion_factor: item.conversion_factor, weight_per_unit: item.weight_per_unit, @@ -1975,7 +1976,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe if (item.item_code) { // Use combination of name and item code in case same item is added multiple times item_codes.push([item.item_code, item.name]); - item_rates[item.name] = item.net_rate; + item_rates[item.name] = item.base_net_rate; item_tax_templates[item.name] = item.item_tax_template; } }); diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 3ecd034e8e13752c3d80e1555898d477858b3c20..b6cb90765c2eb32942ab8bce701e2f8b62995770 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -551,7 +551,7 @@ def get_item_tax_info( args = { "company": company, "tax_category": tax_category, - "net_rate": item_rates.get(item_code[1]), + "base_net_rate": item_rates.get(item_code[1]), "doctype": doctype, } @@ -655,7 +655,7 @@ def is_within_valid_range(args, tax): if not flt(tax.maximum_net_rate): # No range specified, just ignore return True - elif flt(tax.minimum_net_rate) <= flt(args.get("net_rate")) <= flt(tax.maximum_net_rate): + elif flt(tax.minimum_net_rate) <= flt(args.get("base_net_rate")) <= flt(tax.maximum_net_rate): return True return False