brotherton-erpnext/erpnext/crm/call_summary/call_summary_utils.py
2019-05-18 16:11:29 +05:30

18 lines
505 B
Python

import frappe
@frappe.whitelist()
def get_contact_doc(phone_number):
phone_number = phone_number[-10:]
contacts = frappe.get_all('Contact', or_filters={
'phone': ['like', '%{}'.format(phone_number)],
'mobile_no': ['like', '%{}'.format(phone_number)]
}, fields=['name'])
if contacts:
return frappe.get_doc(contacts[0].name)
@frappe.whitelist()
def get_last_communication(phone_number, customer=None):
# find last communication through phone_number
# find last issues, opportunity, lead
pass