Skip to content

Commit d97bc9a

Browse files
committed
fixup! fix: tax_item_rate calculation
1 parent c085b46 commit d97bc9a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

erpnext/public/js/controllers/transaction.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
21082108
return this.frm.call({
21092109
method: "erpnext.stock.get_item_details.get_item_tax_map",
21102110
args: {
2111-
company: me.frm.doc.company,
2111+
doc: me.frm.doc,
21122112
item_tax_template: item.item_tax_template,
21132113
as_json: true
21142114
},

erpnext/stock/get_item_details.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,10 @@ def is_within_valid_range(ctx: ItemDetailsCtx, tax) -> bool:
687687

688688

689689
@frappe.whitelist()
690-
def get_item_tax_map(*, doc: dict | Document, tax_template: str | None = None, as_json=True):
690+
def get_item_tax_map(*, doc: str | dict | Document, tax_template: str | None = None, as_json=True):
691+
doc = parse_json(doc)
691692
item_tax_map = {}
692-
for t in (t for t in doc.get("taxes", []) if not t.set_by_item_tax_template):
693+
for t in (t for t in doc.get("taxes", default=[]) if not t.set_by_item_tax_template):
693694
item_tax_map[t.account_head] = t.rate
694695

695696
if tax_template:

0 commit comments

Comments
 (0)