From 7f9d75521e25d76c0ec71dfc4eaa1ca2bc115d3e Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Mon, 9 Oct 2017 08:13:18 +0100 Subject: [PATCH] Confirmation desired before cancelling appointment (#10996) (#11106) * shows confirm dialog when user clicks cancel * indentation and frm as per review --- .../patient_appointment.js | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js index 86b18842cb6..2532ed115a9 100644 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js @@ -183,16 +183,20 @@ var btn_create_vital_signs = function (frm) { var btn_update_status = function(frm, status){ var doc = frm.doc; - frappe.call({ - method: - "erpnext.healthcare.doctype.patient_appointment.patient_appointment.update_status", - args: {appointmentId: doc.name, status:status}, - callback: function(data){ - if(!data.exc){ - cur_frm.reload_doc(); - } + frappe.confirm(__('Are you sure you want to cancel this appointment?'), + function() { + frappe.call({ + method: + "erpnext.healthcare.doctype.patient_appointment.patient_appointment.update_status", + args: {appointmentId: doc.name, status:status}, + callback: function(data){ + if(!data.exc){ + frm.reload_doc(); + } + } + }); } - }); + ); }; var btn_invoice_consultation = function(frm){