hledger
hledger copied to clipboard
Incorrect historical balance when no transaction in report period
Hi,
I have below ledger test.ledger file:
2024-01-01 * Opening Balance
Assets:Cash 1000.00 USD
Equity:Opening-Balance -1000.00 USD
When I ask for yearly historical balance I get:
> hledger bal ^assets -f test.ledger -b 2025 --historical --yearly
Ending balances (historical) in ..:
==++==
--++--
||
My expectation is to see the 1000 USD since the documentation mentions it "includes postings before report start date".
If I change the ledger file to:
2024-01-01 * Opening Balance
Assets:Cash 1000.00 USD
Equity:Opening-Balance -1000.00 USD
2025-01-01 * Yearly Adjustment
Assets:Cash 0 USD
Equity:Yearly-Adjustment 0 USD
Now the yearly historical balance is correctly reported:
Ending balances (historical) in 2025:
|| 2025-12-31
=============++=============
Assets:Cash || 1000.00 USD
-------------++-------------
|| 1000.00 USD
Good to mention;
> hledger --version
hledger 1.43.1, linux-x86_64
Thanks for the report. I agree that is a little odd. It's not a new behaviour.
Fixed in master.