From f620dae8ca21f2c1f1dc5d0881a2c81d60efce2a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 27 Mar 2018 14:15:36 +0530 Subject: [PATCH] Null issue fixed in gstr reports --- erpnext/regional/report/gstr_1/gstr_1.py | 4 ++-- erpnext/regional/report/gstr_2/gstr_2.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index 96c55ff6250..79d6e12bfb3 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -109,8 +109,8 @@ class Gstr1Report(object): customers = frappe.get_all("Customer", filters={"customer_type": self.customer_type}) if self.filters.get("type_of_business") == "B2B": - conditions += " and invoice_type != 'Export' and is_return != 1 and customer in ('{0}')".\ - format("', '".join([frappe.db.escape(c.name) for c in customers])) + conditions += """ and ifnull(invoice_type, '') != 'Export' and is_return != 1 + and customer in ('{0}')""".format("', '".join([frappe.db.escape(c.name) for c in customers])) if self.filters.get("type_of_business") in ("B2C Large", "B2C Small"): b2c_limit = frappe.db.get_single_value('GSt Settings', 'b2c_limit') diff --git a/erpnext/regional/report/gstr_2/gstr_2.py b/erpnext/regional/report/gstr_2/gstr_2.py index 679e567d42b..0a2e96878f0 100644 --- a/erpnext/regional/report/gstr_2/gstr_2.py +++ b/erpnext/regional/report/gstr_2/gstr_2.py @@ -84,7 +84,7 @@ class Gstr2Report(Gstr1Report): conditions += opts[1] if self.filters.get("type_of_business") == "B2B": - conditions += "and invoice_type != 'Export' and is_return != 1 " + conditions += "and ifnull(invoice_type, '') != 'Export' and is_return != 1 " elif self.filters.get("type_of_business") == "CDNR": conditions += """ and is_return = 1 """