diff --git a/jey_erp/public/js/bank_reconciliation_tool.js b/jey_erp/public/js/bank_reconciliation_tool.js index a143e99..c56e583 100644 --- a/jey_erp/public/js/bank_reconciliation_tool.js +++ b/jey_erp/public/js/bank_reconciliation_tool.js @@ -12,6 +12,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", { // Make BRT fill the page (existing fallback) frm.$wrapper.closest('.page-container').css('--page-max-width', 'none'); + // Patch the DataTableManager prototype once: adds the "Bank Transaction" column. frappe.require("bank-reconciliation-tool.bundle.js", function () { const DTM = erpnext.accounts.bank_reconciliation.DataTableManager; if (!DTM || DTM.prototype._jey_erp_patched) return; @@ -43,9 +44,12 @@ frappe.ui.form.on("Bank Reconciliation Tool", { proto._jey_erp_patched = true; }); + }, - // === 2 + 3: checkbox column + Create & Reconcile toolbar === - // We poll for the DataTableManager instance on the form, then enhance once. + // `render` fires every time the reconciliation tool is (re)built — i.e. on + // every "Get Unreconciled Entries". Each time a brand-new DataTableManager + // is created, so we re-poll for it and re-add the checkbox column + toolbar. + render(frm) { if (frm._bi_check_interval) clearInterval(frm._bi_check_interval); frm._bi_check_interval = setInterval(function () { const dtm = frm.bank_reconciliation_data_table_manager;