diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js index 7742a45746..c24a104fca 100644 --- a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js +++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js @@ -6,6 +6,12 @@ frappe.ui.form.on('Mpesa Settings', { frm.events.setup_account_balance_html(frm); }, + refresh: function(frm) { + frappe.realtime.on("refresh_mpesa_dashboard", function(){ + frm.reload_doc(); + }); + }, + get_account_balance: function(frm) { if (!frm.initiator_name && !frm.security_credentials) return; frappe.call({ diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py index 8fe1972d14..9d34a543e1 100644 --- a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py +++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py @@ -163,6 +163,7 @@ def process_balance_info(**kwargs): ref_doc.db_set("account_balance", balance_info) request.handle_success(account_balance_response) + frappe.publish_realtime("refresh_mpesa_dashboard") except: request.handle_failure(account_balance_response) frappe.log_error(title=_("Mpesa Account Balance Processing Error"), message=account_balance_response) diff --git a/erpnext/selling/page/point_of_sale/pos_payment.js b/erpnext/selling/page/point_of_sale/pos_payment.js index b1f7de00db..2053903943 100644 --- a/erpnext/selling/page/point_of_sale/pos_payment.js +++ b/erpnext/selling/page/point_of_sale/pos_payment.js @@ -175,7 +175,6 @@ erpnext.PointOfSale.Payment = class { }) frappe.realtime.on("process_phone_payment", function(data) { - console.log('within') frappe.dom.unfreeze(); let message = data["ResultDesc"]; let title = __("Payment Failed");