fix: Test case for GSTR-3b report

This commit is contained in:
Deepesh Garg 2021-07-26 18:38:50 +05:30
parent 0011585415
commit d066eab6cd
2 changed files with 10 additions and 3 deletions

View File

@ -281,9 +281,15 @@ class GSTR3BReport(Document):
if self.get('invoice_items'): if self.get('invoice_items'):
# Build itemised tax for export invoices, nil and exempted where tax table is blank # Build itemised tax for export invoices, nil and exempted where tax table is blank
for invoice, items in iteritems(self.invoice_items): for invoice, items in iteritems(self.invoice_items):
if invoice not in self.items_based_on_tax_rate and (self.invoice_detail_map.get(invoice, {}).get('export_type') if invoice not in self.items_based_on_tax_rate and self.invoice_detail_map.get(invoice, {}).get('export_type') \
== "Without Payment of Tax"): == "Without Payment of Tax" and self.invoice_detail_map.get(invoice, {}).get('gst_category') == "Overseas":
self.items_based_on_tax_rate.setdefault(invoice, {}).setdefault(0, items.keys()) self.items_based_on_tax_rate.setdefault(invoice, {}).setdefault(0, items.keys())
else:
for item in items.keys():
if item in self.is_nil_exempt + self.is_non_gst and \
item not in self.items_based_on_tax_rate.get(invoice, {}).get(0, []):
self.items_based_on_tax_rate.setdefault(invoice, {}).setdefault(0, [])
self.items_based_on_tax_rate[invoice][0].append(item)
def set_outward_taxable_supplies(self): def set_outward_taxable_supplies(self):
inter_state_supply_details = {} inter_state_supply_details = {}

View File

@ -287,7 +287,8 @@ class Gstr1Report(object):
# Build itemised tax for export invoices where tax table is blank # Build itemised tax for export invoices where tax table is blank
for invoice, items in iteritems(self.invoice_items): for invoice, items in iteritems(self.invoice_items):
if invoice not in self.items_based_on_tax_rate and invoice not in unidentified_gst_accounts_invoice \ if invoice not in self.items_based_on_tax_rate and invoice not in unidentified_gst_accounts_invoice \
and frappe.db.get_value(self.doctype, invoice, "export_type") == "Without Payment of Tax": and self.invoices.get(invoice, {}).get('export_type') == "Without Payment of Tax" \
and self.invoices.get(invoice, {}).get('gst_category') == "Overseas":
self.items_based_on_tax_rate.setdefault(invoice, {}).setdefault(0, items.keys()) self.items_based_on_tax_rate.setdefault(invoice, {}).setdefault(0, items.keys())
def get_columns(self): def get_columns(self):