fix: 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
parent 1c5220b86f
commit 4a6af25d11

View File

@@ -559,6 +559,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: