fix: Balance Sheet cumulative balance calculation #1224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I noticed this was a critical issue affecting the balance sheet report. I'm an accounting student and hobbyist developer and thought I'd like to take a try to debug.
Incorrect Balances - Resolves #815
Preciously, the balance sheet accounts were displaying incorrect amounts. Upon deeper investigation, I noticed it was the balance that should have been carried over from the previous year. The balance would reset at the beginning of the year.
Changes Implemented:
AccountReport.ts:
Corrected
_getGroupedByDateGrangesto accurately calculate and manage account balances.I changed the concept of
totalBalanceto arunningBalance,which accurately reflects its cumulative balance across the sorted dates.This also included adding an
abstract get rootTypes()for TypeScript compilation.Balance Sheet Report Filters:
Based On: Fiscal Year
Periodicity: Yearly
From Year: 2020
To Year: 2025
I created test journal entries and checked them display consistently across the selected criteria.