From 1eea585d29586eeee1e17853f1267231a7fcc26a Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Sun, 19 Mar 2023 14:02:53 +0530 Subject: [PATCH] refactor: allow for concurrent use of reconciliation tool 1. set default filter dates a period of one month from current date --- .../bank_reconciliation_tool.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js index 22d3335ba1..d977261441 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js +++ b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js @@ -18,6 +18,10 @@ frappe.ui.form.on("Bank Reconciliation Tool", { }, onload: function (frm) { + // Set default filter dates + today = frappe.datetime.get_today() + frm.doc.bank_statement_from_date = frappe.datetime.add_months(today, -1); + frm.doc.bank_statement_to_date = today; frm.trigger('bank_account'); }, @@ -32,6 +36,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", { }, refresh: function (frm) { + frm.disable_save(); frappe.require("bank-reconciliation-tool.bundle.js", () => frm.trigger("make_reconciliation_tool") ); @@ -73,10 +78,11 @@ frappe.ui.form.on("Bank Reconciliation Tool", { }) }); - }, + frm.add_custom_button(__('Get Unreconciled Entries'), function() { + frm.trigger("make_reconciliation_tool"); + }); + frm.change_custom_button_type('Get Unreconciled Entries', null, 'primary'); - after_save: function (frm) { - frm.trigger("make_reconciliation_tool"); }, bank_account: function (frm) {