Skip to content

master: multi-balance reports with a depth limit omit some amounts #2434

@simonmichael

Description

@simonmichael

There's a bug in master, caused by #2395 and not caught by tests, unfortunately. I haven't been able to minimise it more than this yet; the custom account names seem required. Note how with depth limit 1, the A amount is wrongly excluded.

account sm:assets               ; type:A
account sm:revenues             ; type:R

2025-01-01
    sm:revenues
    sm:assets                                     $1

2025-01-02
    sm:revenues                                 A -2
    sm:assets                                    A 2

Limited to depth 2: correct

$ hledger -f a.j is -2
Income Statement 2025-01-01..2025-01-02

             || 2025-01-01..2025-01-02 
=============++========================
 Revenues    ||                        
-------------++------------------------
 sm:revenues ||                $1, A 2 
-------------++------------------------
             ||                $1, A 2 
=============++========================
 Expenses    ||                        
-------------++------------------------
-------------++------------------------
             ||                      0 
=============++========================
 Net:        ||                $1, A 2 

Limited to depth 1: not correct

$ hledger -f a.j is -1
Income Statement 2025-01-01..2025-01-02

          || 2025-01-01..2025-01-02 
==========++========================
 Revenues ||                        
----------++------------------------
 sm       ||                     $1 
----------++------------------------
          ||                     $1 
==========++========================
 Expenses ||                        
----------++------------------------
----------++------------------------
          ||                      0 
==========++========================
 Net:     ||                     $1 

@Xitian9 might you have some time to look at this ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions