hledger
hledger copied to clipboard
Improper elision in budget reports when using tree view
Version
hledger 1.30, mac-aarch64
Reproduction
For this journal file:
~ monthly 2023-08
(income:employment) $-100.00
(income:gifts:cash) $-100.00
2023-07-01 Expense
expenses:rent $100.00
income:gifts:cash
Running hledger bal -p "2023-08" --budget prints the following, as expected:
|| Aug
===================++====================
income || 0 [0% of $-200.00]
income:employment || 0 [0% of $-100.00]
income:gifts:cash || 0 [0% of $-100.00]
-------------------++--------------------
|| 0 [0% of $-200.00]
But if you add the -t (tree) flag to the same command, you instead get:
|| Aug
==============++====================
income || 0 [0% of $-200.00]
employment || 0 [0% of $-100.00]
cash || 0 [0% of $-100.00]
--------------++--------------------
|| 0 [0% of $-200.00]
Which is missing the "gifts" account, making it appear as if "cash" is a subaccount of "employment."
Workaround
Changing the month of the mock transaction to 08 or 09 resolves the issue in this particular example, as does deleting the whole transaction.
Adding --no-elide fixes this issue generally.
Discussion
https://matrix.to/#/!GYlETOAdUBSCcvnEMY:matrix.org/$Fm32JSJs50xGcn4l1v-m5vLz6HQlSr4V4hVg38_0tRw?via=matrix.org&via=vanpetegem.me
Notes from @simonmichael "IIRC the budget report hides accounts with no budget goals by default, and that is not handled well in this tree report" "adding --no-elide works around it"