From 297c7e833c41c3e867a9bfb66e39f8dfe12eb2b6 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 14 Jul 2023 18:39:37 +0530 Subject: [PATCH] fix: Opening entries showing up incorrectly in TB report (#36135) * fix: Opening entries showing up incorrectly in TB report * chore: Linting Issue --- erpnext/accounts/report/financial_statements.py | 2 +- erpnext/accounts/report/trial_balance/trial_balance.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index f3a892ba43cc..db9609debe61 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -416,6 +416,7 @@ def set_gl_entries_by_account( filters, gl_entries_by_account, ignore_closing_entries=False, + ignore_opening_entries=False, ): """Returns a dict like { "account": [gl entries], ... }""" gl_entries = [] @@ -426,7 +427,6 @@ def set_gl_entries_by_account( pluck="name", ) - ignore_opening_entries = False if accounts_list: # For balance sheet if not from_date: diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 7a8b7dc58192..5176c31be717 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -117,6 +117,7 @@ def get_data(filters): filters, gl_entries_by_account, ignore_closing_entries=not flt(filters.with_period_closing_entry), + ignore_opening_entries=True, ) calculate_values(accounts, gl_entries_by_account, opening_balances)