refactor: only consider non-opening balance for Balance sheet accounts

(cherry picked from commit a2b8334046)
This commit is contained in:
ruthra kumar
2026-06-01 12:13:49 +05:30
committed by Mergify
parent 9af618d6bf
commit 5206b279b6

View File

@@ -562,6 +562,9 @@ def process_individual_date(docname: str, date, report_type, parentfield):
if parentfield == "z_opening_balances":
query = query.where(gle.is_opening.eq("Yes"))
else:
# Keep balances aligned with legacy PCV logic (non-opening transactions only)
query = query.where(gle.is_opening.eq("No"))
query = query.groupby(gle.account)
for dim in dimensions: