fix: Tax amount not visible for some invoices

This commit is contained in:
deepeshgarg007 2019-12-19 20:57:40 +05:30
parent 60592e9d43
commit ad9eb9b72c

View File

@ -44,12 +44,16 @@ class Gstr2Report(Gstr1Report):
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)
tax_amount = taxable_value * rate / 100
if inv in self.igst_invoices:
row += [tax_amount, 0, 0]
if inv not in self.igst_invoices:
rate = rate / 2
row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, items)
tax_amount = taxable_value * rate / 100
row += [0, tax_amount, tax_amount]
else:
row += [0, tax_amount / 2, tax_amount / 2]
row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, items)
tax_amount = taxable_value * rate / 100
row += [tax_amount, 0, 0]
row += [
self.invoice_cess.get(inv),