fix: wrong totals in hsn summary report
This commit is contained in:
@@ -35,7 +35,7 @@ def _execute(filters=None):
|
|||||||
data = []
|
data = []
|
||||||
added_item = []
|
added_item = []
|
||||||
for d in item_list:
|
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]
|
row = [d.gst_hsn_code, d.description, d.stock_uom, d.stock_qty]
|
||||||
total_tax = 0
|
total_tax = 0
|
||||||
tax_rate = 0
|
tax_rate = 0
|
||||||
@@ -52,7 +52,7 @@ def _execute(filters=None):
|
|||||||
item_tax = itemised_tax.get((d.parent, d.item_code), {}).get(tax, {})
|
item_tax = itemised_tax.get((d.parent, d.item_code), {}).get(tax, {})
|
||||||
row += [item_tax.get("tax_amount", 0)]
|
row += [item_tax.get("tax_amount", 0)]
|
||||||
data.append(row)
|
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:
|
if data:
|
||||||
data = get_merged_data(columns, data) # merge same hsn code data
|
data = get_merged_data(columns, data) # merge same hsn code data
|
||||||
return columns, data
|
return columns, data
|
||||||
@@ -161,11 +161,9 @@ def get_items(filters):
|
|||||||
GROUP BY
|
GROUP BY
|
||||||
`tabSales Invoice Item`.parent,
|
`tabSales Invoice Item`.parent,
|
||||||
`tabSales Invoice Item`.item_code,
|
`tabSales Invoice Item`.item_code,
|
||||||
`tabSales Invoice Item`.gst_hsn_code,
|
`tabSales Invoice Item`.gst_hsn_code
|
||||||
`tabSales Invoice Item`.uom
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
`tabSales Invoice Item`.gst_hsn_code,
|
`tabSales Invoice Item`.gst_hsn_code
|
||||||
`tabSales Invoice Item`.uom
|
|
||||||
""".format(
|
""".format(
|
||||||
conditions=conditions
|
conditions=conditions
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user