feat: Init call summary popup
This commit is contained in:
parent
dff4cce8fd
commit
8b0588deaf
10
erpnext/crm/call_summary/call_summary_utils.py
Normal file
10
erpnext/crm/call_summary/call_summary_utils.py
Normal file
@ -0,0 +1,10 @@
|
||||
import frappe
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_contact_doc(phone_number):
|
||||
contacts = frappe.get_all('Contact', filters={
|
||||
'phone': phone_number
|
||||
}, fields=['*'])
|
||||
|
||||
if contacts:
|
||||
return contacts[0]
|
@ -48,7 +48,8 @@
|
||||
"public/js/utils/customer_quick_entry.js",
|
||||
"public/js/education/student_button.html",
|
||||
"public/js/education/assessment_result_tool.html",
|
||||
"public/js/hub/hub_factory.js"
|
||||
"public/js/hub/hub_factory.js",
|
||||
"public/js/call_summary_dialog.js"
|
||||
],
|
||||
"js/item-dashboard.min.js": [
|
||||
"stock/dashboard/item_dashboard.html",
|
||||
|
24
erpnext/public/js/call_summary_dialog.js
Normal file
24
erpnext/public/js/call_summary_dialog.js
Normal file
@ -0,0 +1,24 @@
|
||||
frappe.call_summary_dialog = class {
|
||||
constructor(opts) {
|
||||
this.number = '+91234444444';
|
||||
this.make();
|
||||
}
|
||||
|
||||
make() {
|
||||
var d = new frappe.ui.Dialog();
|
||||
this.$modal_body = $(d.body);
|
||||
this.call_summary_dialog = d;
|
||||
$(d.header).html(`<div>Incoming Call: ${this.number}</div>`);
|
||||
frappe.xcall('erpnext.crm.call_summary.call_summary_utils.get_contact_doc', {
|
||||
phone_number: this.number
|
||||
}).then(res => {
|
||||
if (!res) {
|
||||
this.$modal_body.html('Unknown Contact');
|
||||
} else {
|
||||
this.$modal_body.html(`${res.first_name}`);
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
}
|
||||
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user