feat: Init call summary popup
diff --git a/erpnext/crm/call_summary/call_summary_utils.py b/erpnext/crm/call_summary/call_summary_utils.py
new file mode 100644
index 0000000..822fb3e
--- /dev/null
+++ b/erpnext/crm/call_summary/call_summary_utils.py
@@ -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]
\ No newline at end of file
diff --git a/erpnext/public/build.json b/erpnext/public/build.json
index 45de6eb..25fe0d6 100644
--- a/erpnext/public/build.json
+++ b/erpnext/public/build.json
@@ -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",
diff --git a/erpnext/public/js/call_summary_dialog.js b/erpnext/public/js/call_summary_dialog.js
new file mode 100644
index 0000000..c4c6d48
--- /dev/null
+++ b/erpnext/public/js/call_summary_dialog.js
@@ -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();
+ }
+
+};
\ No newline at end of file