fix: Customer Credit Balance Report query fix (#19105)

This commit is contained in:
Marica 2019-09-18 20:00:39 +05:30 committed by Anurag Mishra
parent 50e591b815
commit cef75a5987

View File

@ -60,7 +60,7 @@ def get_details(filters):
conditions = "" conditions = ""
if filters.get("customer"): if filters.get("customer"):
conditions += " AND c.name = " + filters.get("customer") conditions += " AND c.name = '" + filters.get("customer") + "'"
return frappe.db.sql("""SELECT return frappe.db.sql("""SELECT
c.name, c.customer_name, c.name, c.customer_name,
@ -69,6 +69,6 @@ def get_details(filters):
FROM `tabCustomer` c, `tabCustomer Credit Limit` ccl FROM `tabCustomer` c, `tabCustomer Credit Limit` ccl
WHERE WHERE
c.name = ccl.parent c.name = ccl.parent
AND ccl.company = %s AND ccl.company = '{0}'
{0} {1}
""".format(conditions), (filters.get("company")), as_dict=1) #nosec """.format( filters.get("company"),conditions), as_dict=1) #nosec