From 3aaa2f5326b13dbf390d86da9917fbb5def447ae Mon Sep 17 00:00:00 2001 From: sonali Date: Thu, 29 Dec 2022 12:05:22 +0530 Subject: [PATCH] fix: filtered as per reference date On bank reconciliation, transactions will be filtered as per date selected in 'from_date' and 'to_date' fields , In dialog, all the bank entries will be fetched as per the posting date selected and if filtered by reference date checkbox is tick then then there will be two fields 'from_reference_date' and 'to_reference_date' then all bank entries in dialog box came as per reference date, selected. And by default journal entry checkbox is tick. Also sorted the bank transactions and bank entries as per ascending order date wise. --- .../bank_reconciliation_tool/bank_reconciliation_tool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py index 44583c1777b..3d78ea300f1 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py +++ b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py @@ -8,7 +8,7 @@ import frappe from frappe import _ from frappe.model.document import Document from frappe.query_builder.custom import ConstantColumn -from frappe.utils import flt +from frappe.utils import flt , cint from erpnext.accounts.doctype.bank_transaction.bank_transaction import get_paid_amount from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_statement import ( @@ -601,7 +601,7 @@ def get_pe_matching_query( currency_field = "paid_from_account_currency as currency" filter_by_date = f"AND posting_date between '{from_date}' and '{to_date}'" order_by = " posting_date" - if filtered_by_reference_date == "1": + if cint(filtered_by_reference_date): filter_by_date = f"AND reference_date between '{from_reference_date}' and '{to_reference_date}'" order_by = " reference_date" return f""" @@ -648,7 +648,7 @@ def get_je_matching_query( cr_or_dr = "credit" if transaction.withdrawal > 0 else "debit" # filter_by_date = f"AND je.posting_date between '{from_date}' and '{to_date}'" order_by = " je.posting_date" - if filtered_by_reference_date == "1": + if cint(filtered_by_reference_date): filter_by_date = f"AND je.cheque_date between '{from_reference_date}' and '{to_reference_date}'" order_by = " je.cheque_date"