feat(Contacts): Multiple Emails in a Contact (#18675)
* feat: render multiple addresses
* feat: move to newer contacts structure
* fix: iterate over valid variable
* fix: use primary label instead of bold letters
* fix: call popup get contact name from number
* fix: make contact structure call popup compatible
* fix: query
* fix: add city, state and country
* fix: display address
* fix: get address in single line
* fix: review fixes
* fix: translation strings
* fix: fix query for contacts
* fix: remove references of mobile_no
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index e290b23..7e23793 100755
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -227,8 +227,8 @@
customers = [frappe._dict({'name': customers})]
for data in customers:
- contact = frappe.db.sql(""" select email_id, phone, mobile_no from `tabContact`
- where is_primary_contact =1 and name in
+ contact = frappe.db.sql(""" select email_id, phone from `tabContact`
+ where is_primary_contact=1 and name in
(select parent from `tabDynamic Link` where link_doctype = 'Customer' and link_name = %s
and parenttype = 'Contact')""", data.name, as_dict=1)
if contact:
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index b5a02d0..0e73012 100755
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -816,7 +816,6 @@
contact = me.contacts[data.name];
if(reg.test(data.name.toLowerCase())
|| reg.test(data.customer_name.toLowerCase())
- || (contact && reg.test(contact["mobile_no"]))
|| (contact && reg.test(contact["phone"]))
|| (data.customer_group && reg.test(data.customer_group.toLowerCase()))){
return data;
@@ -834,7 +833,6 @@
if(contact && !c['phone']) {
c["phone"] = contact["phone"];
c["email_id"] = contact["email_id"];
- c["mobile_no"] = contact["mobile_no"];
}
me.customers_mapper.push({
@@ -844,10 +842,9 @@
customer_group: c.customer_group,
territory: c.territory,
phone: contact ? contact["phone"] : '',
- mobile_no: contact ? contact["mobile_no"] : '',
email_id: contact ? contact["email_id"] : '',
searchtext: ['customer_name', 'customer_group', 'name', 'value',
- 'label', 'email_id', 'phone', 'mobile_no']
+ 'label', 'email_id', 'phone']
.map(key => c[key]).join(' ')
.toLowerCase()
});