fix: GSTR-2 Report fixes (#17903)

This commit is contained in:
Deepesh Garg 2019-06-14 12:02:36 +05:30 committed by Nabin Hait
parent 459155fae1
commit b095d0a0c5
2 changed files with 9 additions and 3 deletions

View File

@ -209,7 +209,10 @@ class Gstr1Report(object):
sum(i.get('base_net_amount', 0) for i in items
if i.item_code == d.item_code and i.parent == d.parent))
item_tax_rate = json.loads(d.item_tax_rate)
item_tax_rate = {}
if d.item_tax_rate:
item_tax_rate = json.loads(d.item_tax_rate)
if item_tax_rate:
self.item_tax_rate.setdefault(d.parent, {}).setdefault(d.item_code, item_tax_rate)

View File

@ -43,8 +43,11 @@ class Gstr2Report(Gstr1Report):
self.get_igst_invoices()
for inv, items_based_on_rate in self.items_based_on_tax_rate.items():
invoice_details = self.invoices.get(inv)
for rate, items in items_based_on_rate.items():
row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, items)
for key, items in items_based_on_rate.items():
rate = key[0]
account = key[1]
row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, account, items)
tax_amount = taxable_value * rate / 100
if inv in self.igst_invoices:
row += [tax_amount, 0, 0]