diff --git a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js index b1087a2e9..0ed472bc6 100644 --- a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js +++ b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js @@ -70,15 +70,6 @@ frappe.ui.form.on("Purchase Reconciliation Tool", { await frappe.require("purchase_reconciliation_tool.bundle.js"); frm.trigger("company"); frm.purchase_reconciliation_tool = new PurchaseReconciliationTool(frm); - - frappe.realtime.on("download_failed", message => { - frm.dashboard.hide(); - frappe.msgprint({ - title: __("Download Failed"), - message: message.error, - indicator: "red" - }); - }) }, onload(frm) { @@ -198,6 +189,7 @@ frappe.ui.form.on("Purchase Reconciliation Tool", { () => frm.events.update_progress(frm, "update_api_progress"), () => frm.events.update_progress(frm, "update_transactions_progress"), ]); + frm.events.handle_download_failure(frm); } else if (type == "upload") { frm.events.update_progress(frm, "update_transactions_progress"); } @@ -238,6 +230,17 @@ frappe.ui.form.on("Purchase Reconciliation Tool", { } }); }, + + handle_download_failure(frm) { + frappe.realtime.on("download_failed", message => { + frm.dashboard.hide(); + frappe.msgprint({ + title: __("Download Failed"), + message: message.error, + indicator: "red" + }); + }) + }, }); class PurchaseReconciliationTool {