hledger/tests/balance/depth.test
Simon Michael 7f6cf1f849 balance, register, register-csv: depth 0 shows summary items (#206)
Previously, a depth:0 query produced an empty report (since there are no
level zero accounts). Now, it aggregates all data into one summary item
with account name "...".

This makes it easier to see the kind of data Gwern was looking for from
register-csv (net worth over time). Eg this shows one line per month
summarising the total of assets and liabilities:

hledger register-csv -- -MHE ^assets ^liabilities depth:0

Single and multi-column balance reports behave similarly.
2014-10-19 17:53:20 -07:00

29 lines
577 B
Plaintext

# 1.
hledgerdev -f sample.journal balance --no-total --depth 1
>>>
$-1 assets
$2 expenses
$-2 income
$1 liabilities
>>>=0
# 2. Depth 0 aggregates everything into one line
hledgerdev -f sample.journal balance --no-total --depth 0
>>>
0 ...
>>>=0
# 3. Ditto in a multi-column balance report.
hledgerdev -f sample.journal balance -M -e 2008/4 --depth 0
>>>
Balance changes in 2008/01:
|| 2008/01
=====++==========
... || 0
-----++----------
|| 0
>>>=0