Skip to content

Commit

Permalink
fix: wrong totals in hsn summary report
Browse files Browse the repository at this point in the history
  • Loading branch information
rtdany10 committed Nov 12, 2022
1 parent a0cab4c commit 79d508f
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _execute(filters=None):
data = []
added_item = []
for d in item_list:
if (d.parent, d.item_code) not in added_item:
if (d.parent, d.gst_hsn_code, d.item_code) not in added_item:
row = [d.gst_hsn_code, d.description, d.stock_uom, d.stock_qty]
total_tax = 0
tax_rate = 0
Expand All @@ -52,7 +52,7 @@ def _execute(filters=None):
item_tax = itemised_tax.get((d.parent, d.item_code), {}).get(tax, {})
row += [item_tax.get("tax_amount", 0)]
data.append(row)
added_item.append((d.parent, d.item_code))
added_item.append((d.parent, d.gst_hsn_code, d.item_code))
if data:
data = get_merged_data(columns, data) # merge same hsn code data
return columns, data
Expand Down Expand Up @@ -161,11 +161,9 @@ def get_items(filters):
GROUP BY
`tabSales Invoice Item`.parent,
`tabSales Invoice Item`.item_code,
`tabSales Invoice Item`.gst_hsn_code,
`tabSales Invoice Item`.uom
`tabSales Invoice Item`.gst_hsn_code
ORDER BY
`tabSales Invoice Item`.gst_hsn_code,
`tabSales Invoice Item`.uom
`tabSales Invoice Item`.gst_hsn_code
""".format(
conditions=conditions
),
Expand Down

0 comments on commit 79d508f

Please sign in to comment.