Skip to content

1.23-1.32.3: wrong account name elision in tree-mode balance --budget reports #2071

Description

@williamcpierce

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.affects4-manyAffects potentially a significant number of users.annoyance4-majorMajor usability/doc bug, or any regression or crash.balancebountyThar's some kind o' loot on offer..budgetThe balance command's --budget reportregressionA backwards step, indicating a weakness in our QA. We don't like these.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions