fix taxable amount for same items (#13927)

This commit is contained in:
Shreya Shah 2018-05-04 18:01:23 +05:30 committed by Nabin Hait
parent 764b9bfeba
commit 55daa9cd24

View File

@ -144,7 +144,17 @@ class Gstr1Report(object):
""" % (self.doctype, ', '.join(['%s']*len(self.invoices))), tuple(self.invoices), as_dict=1)
for d in items:
self.invoice_items.setdefault(d.parent, {}).setdefault(d.item_code, d.base_net_amount)
item_details = {}
item_details[d.item_code] = d.base_net_amount
if d.parent in self.invoice_items:
parent_dict = self.invoice_items[d.parent]
if d.item_code in parent_dict:
item_details[d.item_code] += parent_dict[d.item_code]
else:
item_details.update(parent_dict)
self.invoice_items[d.parent] = item_details
def get_items_based_on_tax_rate(self):
self.tax_details = frappe.db.sql("""