fix: intake page updates, customer_intake fixes, module dir
This commit is contained in:
@@ -7,12 +7,12 @@ def search_customers(q=""):
|
||||
return []
|
||||
q = q.strip().lower()
|
||||
customers = frappe.db.sql("""
|
||||
SELECT c.name, c.customer_name, c.customer_number, c.phone, c.email_id,
|
||||
SELECT c.name, c.customer_name, c.customer_number, c.mobile_no,
|
||||
a.address_line1, a.city, a.state, a.pincode
|
||||
FROM tabCustomer c
|
||||
LEFT JOIN tabDynamic Link dl ON dl.link_doctype = 'Customer' AND dl.link_name = c.name AND dl.parenttype = 'Address'
|
||||
LEFT JOIN `tabDynamic Link` dl ON dl.link_doctype = 'Customer' AND dl.link_name = c.name AND dl.parenttype = 'Address'
|
||||
LEFT JOIN tabAddress a ON a.name = dl.parent
|
||||
WHERE LOWER(c.customer_name) LIKE %s OR LOWER(c.customer_number) LIKE %s OR LOWER(c.phone) LIKE %s
|
||||
WHERE LOWER(c.customer_name) LIKE %s OR LOWER(c.customer_number) LIKE %s OR LOWER(c.mobile_no) LIKE %s
|
||||
ORDER BY c.customer_name
|
||||
LIMIT 20
|
||||
""", ("%" + q + "%", "%" + q + "%", "%" + q + "%"), as_dict=True)
|
||||
@@ -27,7 +27,7 @@ def get_customer(name):
|
||||
addr = frappe.db.sql("""
|
||||
SELECT a.address_line1, a.city, a.state, a.pincode, a.phone
|
||||
FROM tabAddress a
|
||||
JOIN tabDynamic Link dl ON dl.parent = a.name AND dl.link_doctype = 'Customer' AND dl.link_name = %s
|
||||
JOIN `tabDynamic Link` dl ON dl.parent = a.name AND dl.link_doctype = 'Customer' AND dl.link_name = %s
|
||||
LIMIT 1
|
||||
""", (name,), as_dict=True)
|
||||
if addr:
|
||||
@@ -50,7 +50,7 @@ def create_customer_from_intake(data):
|
||||
customer.customer_group = data.get("customer_group", "IT Recycling")
|
||||
customer.customer_type = "Company"
|
||||
customer.customer_number = data.get("customer_number")
|
||||
customer.phone = data.get("phone")
|
||||
customer.mobile_no = data.get("phone")
|
||||
customer.email_id = data.get("email_id")
|
||||
customer.legacy_notes = data.get("legacy_notes")
|
||||
customer.hours_of_operation = data.get("hours_of_operation")
|
||||
|
||||
Reference in New Issue
Block a user