hledger/tests/balance-flat.test
Simon Michael 6a928a03a8 overhaul single- and multi-column balance reports
Changes include:

- flat mode now shows exclusive (subaccount-excluding) balances.
  This is a deviation from ledger, but seems simpler and clearer
  for users and implementors across the various modes.

- in flat mode, --depth now aggregates deeper accounts at the
  depth limit, rather than just excluding them from the report.
  This is more useful.

- in flat mode, --empty no longer shows parent accounts with
  no postings.

- more tests, more debug output, clearer code
2014-04-03 18:49:57 -07:00

52 lines
1010 B
Plaintext

# --flat shows inclusive balances; total balance should be that of top-level accounts (issue 94)
# # 1.
# hledgerdev -f - balance --flat
# <<<
# 1/1
# (a) 1
# (a:aa) 1
# >>>
# 2 a
# 1 a:aa
# --------------------
# 2
# >>>= 0
# --flat shows exclusive balances
# 1.
hledgerdev -f - balance --flat
<<<
1/1
(a:aa) 1
(a:aa:aaa) 1
(a:aa:bbb) 1
(b) 1
(b:bb:bbb) 1
>>>
1 a:aa
1 a:aa:aaa
1 a:aa:bbb
1 b
1 b:bb:bbb
--------------------
5
>>>= 0
# --flat --depth shows the same accounts, but clipped and aggregated at the depth limit
# 2.
hledgerdev -f - balance --flat --depth 2
<<<
1/1
(a:aa) 1
(a:aa:aaa) 1
(a:aa:bbb) 1
(b) 1
(b:bb:bbb) 1
>>>
3 a:aa
1 b
1 b:bb
--------------------
5
>>>= 0