Browse Source

fix: escape quotes while fetching customer emails (#26329)

develop
Saqib 3 years ago
committed by GitHub
parent
commit
eaef371585
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py

7
erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py

@ -207,10 +207,9 @@ def fetch_customers(customer_collection, collection_name, primary_mandatory):
@frappe.whitelist()
def get_customer_emails(customer_name, primary_mandatory, billing_and_primary=True):
billing_email = frappe.db.sql("""
SELECT c.email_id FROM `tabContact` AS c JOIN `tabDynamic Link` AS l ON c.name=l.parent \
WHERE l.link_doctype='Customer' and l.link_name='""" + customer_name + """' and \
c.is_billing_contact=1 \
order by c.creation desc""")
SELECT c.email_id FROM `tabContact` AS c JOIN `tabDynamic Link` AS l ON c.name=l.parent
WHERE l.link_doctype='Customer' and l.link_name=%s and c.is_billing_contact=1
order by c.creation desc""", customer_name)
if len(billing_email) == 0 or (billing_email[0][0] is None):
if billing_and_primary:

Loading…
Cancel
Save