From 366451fc62ab5055c2e0ad30ced26839bb15ffd8 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Sun, 8 Sep 2019 09:51:15 +0530 Subject: [PATCH] fix: Minor fix in GSTR-1 --- erpnext/regional/report/gstr_1/gstr_1.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index c397133f33..43e232bf72 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -163,15 +163,14 @@ class Gstr1Report(object): if not b2c_limit: frappe.throw(_("Please set B2C Limit in GST Settings.")) - if self.filters.get("type_of_business") == "B2C Large" and customers: + if self.filters.get("type_of_business") == "B2C Large": conditions += """ and SUBSTR(place_of_supply, 1, 2) != SUBSTR(company_gstin, 1, 2) - and grand_total > {0} and is_return != 1 and gst_category ='Unregistered' """.\ - format(flt(b2c_limit), ", ".join([frappe.db.escape(c.name) for c in customers])) - elif self.filters.get("type_of_business") == "B2C Small" and customers: + and grand_total > {0} and is_return != 1 and gst_category ='Unregistered' """.format(flt(b2c_limit)) + + elif self.filters.get("type_of_business") == "B2C Small": conditions += """ and ( SUBSTR(place_of_supply, 1, 2) = SUBSTR(company_gstin, 1, 2) - or grand_total <= {0}) and is_return != 1 and gst_category ='Unregistered' """.\ - format(flt(b2c_limit), ", ".join([frappe.db.escape(c.name) for c in customers])) + or grand_total <= {0}) and is_return != 1 and gst_category ='Unregistered' """.format(flt(b2c_limit)) elif self.filters.get("type_of_business") == "CDNR": conditions += """ and is_return = 1 """