Null issue fixed in gstr reports

This commit is contained in:
Nabin Hait 2018-03-27 14:15:36 +05:30
parent 9d7fe1f7cd
commit f620dae8ca
2 changed files with 3 additions and 3 deletions

View File

@ -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')

View File

@ -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 """