diff --git a/erpnext/support/doctype/issue/issue.js b/erpnext/support/doctype/issue/issue.js index 9ac1efa268d0..1e81640a7eab 100644 --- a/erpnext/support/doctype/issue/issue.js +++ b/erpnext/support/doctype/issue/issue.js @@ -41,6 +41,54 @@ frappe.ui.form.on("Issue", { } }, + refresh: function(frm) { + // alert messages + if (frm.doc.status !== "Closed" && frm.doc.service_level_agreement + && frm.doc.agreement_status === "Ongoing") { + frappe.call({ + "method": "frappe.client.get", + args: { + doctype: "Service Level Agreement", + name: frm.doc.service_level_agreement + }, + callback: function(data) { + let statuses = data.message.pause_sla_on; + const hold_statuses = []; + $.each(statuses, (_i, entry) => { + hold_statuses.push(entry.status); + }); + if (hold_statuses.includes(frm.doc.status)) { + frm.dashboard.clear_headline(); + let message = { "indicator": "orange", "msg": __("SLA is on hold since {0}", [moment(frm.doc.on_hold_since).fromNow(true)]) }; + frm.dashboard.set_headline_alert( + '