Balance Report with -V unbalanced when multiple lots on same day

29 views
Skip to first unread message

swspry

unread,
Oct 30, 2025, 2:16:10 AM (7 days ago) Oct 30
to Ledger
Hi, 
I was hoping someone could help me identify if the below is a bug or just user error on my part.

When I run ledger -f journal.ledger -V bal on the below file it shows as unbalanced (-0.03).
When I run ledger -f journal.ledger -B bal on the below file it shows as balanced.

If I change the postings to be different, it balances. It seems to be an issue with everything happening on the same day. I've tried this with ledger 3.2.2 (fedora repo), 3.2.1 (ubuntu repo), and 3.4.1 (compiled from source)

I also tried combining it into one transaction, and that still has the same issue.

I'm not sure if I'm missing an option, or something else. But this seem very weird to me.

journal.ledger
--------------------------
account Assets:Etrade:Personal:SWTSX
account Assets:Etrade:Personal:SWTSX:Dividend
commodity SWTSX
2021-12-13 * "Buying SWTSX"
Assets:Etrade:Personal:SWTSX:Dividend  0.012 SWTSX @ 83.33333333333333333333333333 USD
Equity:Brokerage-Rounding
Equity:Opening-Balances  -1 USD

2021-12-13 * "Buying SWTSX"
Assets:Etrade:Personal:SWTSX:Dividend  0.002 SWTSX @ 85 USD
Equity:Brokerage-Rounding
Equity:Opening-Balances  -0.17 USD

2021-12-13 * "Buying SWTSX"
Assets:Etrade:Personal:SWTSX:Dividend  0.059 SWTSX @ 81.18644067796610169491525424 USD
Equity:Brokerage-Rounding
Equity:Opening-Balances  -4.79 USD

swspry

unread,
Oct 30, 2025, 8:50:52 AM (7 days ago) Oct 30
to Ledger
Forgot to mention that I was adding the --unrealized flag as well

me@me % ledger -f journal.ledger -V bal --unrealized
            5.93 USD  Assets:Etrade:Personal:SWTSX:Dividend
           -5.96 USD  Equity:Opening-Balances
--------------------
           -0.03 USD
me@me %

swspry

unread,
Oct 31, 2025, 10:25:05 PM (5 days ago) Oct 31
to Ledger
It looks like this is a known issue https://github.com/ledger/ledger/issues/1821
If anyone has a work-around for this I would like to know.
Reply all
Reply to author
Forward
0 new messages