From 30c73e6b357dc547fdcb09a35a299c5a1c38d53a Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Mon, 27 May 2019 11:48:40 +0530 Subject: [PATCH] fix: Only show registered customers for GSTR-1 B2B Report (#17719) --- erpnext/regional/report/gstr_1/gstr_1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index 9369504b82f..a71a83a6bb0 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -149,7 +149,8 @@ class Gstr1Report(object): if self.filters.get("type_of_business") == "B2B": 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])) + and customer in ('{0}') and (customer_gstin IS NOT NULL OR customer_gstin NOT IN ('', 'NA'))""".\ + 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')