Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper elision in budget reports when using tree view #2071

Closed
williamcpierce opened this issue Aug 23, 2023 · 3 comments
Closed

Improper elision in budget reports when using tree view #2071

williamcpierce opened this issue Aug 23, 2023 · 3 comments
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. balance bounty Thar's some kind o' loot on offer.. budget The balance command's --budget report impact4 Affects more than a few users. regression A backwards step, indicating a weakness in our QA. We don't like these. severity4 Major usability/doc bug, crash, or any regression.

Comments

@williamcpierce
Copy link

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"

@williamcpierce williamcpierce added the A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. label Aug 23, 2023
@simonmichael simonmichael added balance budget The balance command's --budget report labels Aug 24, 2023
@simonmichael simonmichael added impact4 Affects more than a few users. severity4 Major usability/doc bug, crash, or any regression. labels Jan 28, 2024
simonmichael added a commit that referenced this issue Feb 25, 2024
)

Parent accounts with no actual or goal amounts would ideally be shown
elided on the same line, but the budget report in tree mode was
omitting them completely. Now --budget always shows them.
The effect is much like forcing --no-elide on, except it might not
show goal amounts that --no-elide does show.

It's not a wonderful fix, but the budget report code is twisty and I
can't afford to spend more time on this.
@simonmichael
Copy link
Owner

simonmichael commented Feb 25, 2024

I found this hard to debug and hard to fix. I have pushed a best effort fix which essentially forces --no-elide when doing bal --budget --tree. Boring parent accounts won't get elided on the same line as their subaccount as they should, but at least they are not omitted causing wrong reports. Any testing / improvements welcome.

@simonmichael simonmichael added regression A backwards step, indicating a weakness in our QA. We don't like these. bounty Thar's some kind o' loot on offer.. labels Feb 25, 2024
@simonmichael
Copy link
Owner

I see this regressed in hledger 1.23 in 2021. @williamcpierce, claim your http://hledger.org/REGRESSIONS.html#regression-bounty when convenient. 1.22 and earlier behaved like the latest fix, ie, forcing each displayed account to have its own line.

simonmichael added a commit that referenced this issue Feb 25, 2024
adept pushed a commit to adept/hledger that referenced this issue Mar 8, 2024
…monmichael#2071)

Parent accounts with no actual or goal amounts would ideally be shown
elided on the same line, but the budget report in tree mode was
omitting them completely. Now --budget always shows them.
The effect is much like forcing --no-elide on, except it might not
show goal amounts that --no-elide does show.

It's not a wonderful fix, but the budget report code is twisty and I
can't afford to spend more time on this.
adept pushed a commit to adept/hledger that referenced this issue Mar 8, 2024
@williamcpierce
Copy link
Author

I see this regressed in hledger 1.23 in 2021. @williamcpierce, claim your http://hledger.org/REGRESSIONS.html#regression-bounty when convenient. 1.22 and earlier behaved like the latest fix, ie, forcing each displayed account to have its own line.

Submitted, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. balance bounty Thar's some kind o' loot on offer.. budget The balance command's --budget report impact4 Affects more than a few users. regression A backwards step, indicating a weakness in our QA. We don't like these. severity4 Major usability/doc bug, crash, or any regression.
Projects
None yet
Development

No branches or pull requests

2 participants