From 313ad7ae89d77969d5c950ac45a1a2dda60fa881 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 14:20:28 +0530 Subject: [PATCH] fix: Opening balance in TB report (#36171) fix: Opening balance in TB report (#36171) (cherry picked from commit cfae52a40a145fe204639d1b2abf84012f88e542) Co-authored-by: Deepesh Garg --- erpnext/accounts/report/trial_balance/trial_balance.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 5176c31be717..39917f90c939 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -221,7 +221,10 @@ def get_opening_balance( ) else: if start_date: - opening_balance = opening_balance.where(closing_balance.posting_date >= start_date) + opening_balance = opening_balance.where( + (closing_balance.posting_date >= start_date) + & (closing_balance.posting_date < filters.from_date) + ) opening_balance = opening_balance.where(closing_balance.is_opening == "No") else: opening_balance = opening_balance.where(