Force balance report to always put sub accounts in own node

27 views
Skip to first unread message

Nikita Skobelevs

unread,
Oct 8, 2023, 12:34:05 PM10/8/23
to Ledger
Hi,

I was wondering if it's possible to force the balance report to always have sub accounts as new nodes in the indented tree even if there's only 1 sub account? Either with some flag or custom --balance-format?

Example:

 Current Output:
      xx.xx  Expenses
      xx.xx    Baz:Foo
      xx.xx    Bar:Qux
---------------
          0

Desired output:
      xx.xx  Expenses
      xx.xx    Baz
      xx.xx      Foo
      xx.xx    Bar
      xx.xx      Qux
---------------
             0

Thanks,
Nikita

John Wiegley

unread,
Oct 9, 2023, 7:04:50 PM10/9/23
to Nikita Skobelevs, Ledger
>>>>> "NS" == Nikita Skobelevs <nikita.s...@gmail.com> writes:

NS> I was wondering if it's possible to force the balance report to
NS> always have sub accounts as new nodes in the indented tree even if
NS> there's only 1 sub account? Either with some flag or custom
NS> --balance-format?

Does --empty does what you want?

John

Nikita Skobelevs

unread,
Oct 10, 2023, 4:52:23 AM10/10/23
to Ledger
Hi John,

--empty seems relevant but not quite what I'm looking for.
It would help in the above example if I already had some account Baz:* that was 0 and not displayed, but in this case Foo is the only subaccount in Baz so --empty doesn't change how it's displayed
I'm assuming there's logic somewhere checking if there's more than 1 subaccount and if so putting them over multiple lines - I'm looking for a way to force that behaviour so every ":" forces a new node in the indented tree.

Regards,

John Wiegley

unread,
Oct 11, 2023, 2:02:43 PM10/11/23
to Nikita Skobelevs, Ledger
>>>>> "NS" == Nikita Skobelevs <nikita.s...@gmail.com> writes:

NS> --empty seems relevant but not quite what I'm looking for.
NS> It would help in the above example if I already had some account
NS> Baz:* that was 0 and not displayed, but in this case Foo is the only
NS> subaccount in Baz so --empty doesn't change how it's displayed
NS> I'm assuming there's logic somewhere checking if there's more than 1
NS> subaccount and if so putting them over multiple lines - I'm looking
NS> for a way to force that behaviour so every ":" forces a new node in
NS> the indented tree.

I’m reading the code, but it’s been a while since I last worked on it. I don’t
think this feature exists, but I agree it’s a pretty obvious omission for it
not to be there. There should be a way to ask it not to collapse accounts,
even if they are empty or unused.

John
Reply all
Reply to author
Forward
0 new messages