Skip to content

Commit

Permalink
Merge pull request #2348 from vorasmit/fix-hsn-summary
Browse files Browse the repository at this point in the history
fix: fallback for HSN summary to `item_name` for item key
  • Loading branch information
vorasmit committed Jul 5, 2024
2 parents 70711a8 + 7756874 commit 6f0813e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def get_hsn_data(filters, columns):
added_item = set()

for d in item_list:
key = (d.parent, d.gst_hsn_code, d.item_code)
item_key = d.item_code or d.item_name
key = (d.parent, d.gst_hsn_code, item_key)
if key in added_item:
continue

Expand All @@ -53,7 +54,7 @@ def get_hsn_data(filters, columns):
total_tax = 0
tax_rate = 0

item_tax = itemised_tax.get((d.parent, d.item_code), {})
item_tax = itemised_tax.get((d.parent, item_key), {})
for tax in tax_columns:
tax_data = item_tax.get(tax, {})
total_tax += flt(tax_data.get("tax_amount", 0), 2)
Expand Down Expand Up @@ -201,6 +202,7 @@ def get_items(filters):
sum(`tabSales Invoice Item`.taxable_value) AS taxable_value,
`tabSales Invoice Item`.parent,
`tabSales Invoice Item`.item_code,
`tabSales Invoice Item`.item_name,
COALESCE(`tabGST HSN Code`.description, 'NA') AS description
FROM
`tabSales Invoice`
Expand Down

0 comments on commit 6f0813e

Please sign in to comment.