Skip to content

Commit

Permalink
fixup! fix: tax_item_rate calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Nov 23, 2024
1 parent c085b46 commit d97bc9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
return this.frm.call({
method: "erpnext.stock.get_item_details.get_item_tax_map",
args: {
company: me.frm.doc.company,
doc: me.frm.doc,
item_tax_template: item.item_tax_template,
as_json: true
},
Expand Down
5 changes: 3 additions & 2 deletions erpnext/stock/get_item_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,10 @@ def is_within_valid_range(ctx: ItemDetailsCtx, tax) -> bool:


@frappe.whitelist()
def get_item_tax_map(*, doc: dict | Document, tax_template: str | None = None, as_json=True):
def get_item_tax_map(*, doc: str | dict | Document, tax_template: str | None = None, as_json=True):
doc = parse_json(doc)
item_tax_map = {}
for t in (t for t in doc.get("taxes", []) if not t.set_by_item_tax_template):
for t in (t for t in doc.get("taxes", default=[]) if not t.set_by_item_tax_template):
item_tax_map[t.account_head] = t.rate

if tax_template:
Expand Down

0 comments on commit d97bc9a

Please sign in to comment.