mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-29 05:11:33 +03:00
e491f513a1
Tabular reports from bal, bs etc. have until now been rendered on the terminal with one final blank line, for readability. This change drops the blank line. This is consistent with the non-tabular balance and register output (not print, which is a special case), and with most unix commands. The real reason for it, which I admit is flimsy, is that I can now omit the final delimiter (>=0) when using shelltestrunner 1.9's new format, making functional tests easier to maintain and more readable. If there's opposition, this could be reverted.
102 lines
2.6 KiB
Plaintext
102 lines
2.6 KiB
Plaintext
# Test --forecast switch
|
|
hledger bal -M -b 2016-11 -e 2017-02 -f - --forecast
|
|
<<<
|
|
2016/12/31
|
|
expenses:housing $600
|
|
assets:cash
|
|
|
|
~ monthly from 2016/1
|
|
income $-1000
|
|
expenses:food $20
|
|
expenses:leisure $15
|
|
expenses:grocery $30
|
|
assets:cash
|
|
>>>
|
|
Balance changes in 2016/12/01-2017/01/31:
|
|
|
|
|| 2016/12 2017/01
|
|
==================++==================
|
|
assets:cash || $-600 $935
|
|
expenses:food || 0 $20
|
|
expenses:grocery || 0 $30
|
|
expenses:housing || $600 0
|
|
expenses:leisure || 0 $15
|
|
income || 0 $-1000
|
|
------------------++------------------
|
|
|| 0 0
|
|
>>>2
|
|
>>>=0
|
|
|
|
|
|
hledger print -b 2016-11 -e 2017-02 -f - --forecast
|
|
<<<
|
|
2016/12/31
|
|
expenses:housing $600
|
|
assets:cash
|
|
|
|
~ monthly from 2016/1
|
|
income $-1000
|
|
expenses:food $20
|
|
expenses:leisure $15
|
|
expenses:grocery $30
|
|
assets:cash
|
|
>>>
|
|
2016/12/31
|
|
expenses:housing $600
|
|
assets:cash
|
|
|
|
2017/01/01 Forecast transaction
|
|
income $-1000
|
|
expenses:food $20
|
|
expenses:leisure $15
|
|
expenses:grocery $30
|
|
assets:cash
|
|
|
|
>>>2
|
|
>>>=0
|
|
|
|
|
|
hledger register -b 2016-11 -e 2017-02 -f - --forecast
|
|
<<<
|
|
2016/12/31
|
|
expenses:housing $600
|
|
assets:cash
|
|
|
|
~ monthly from 2016/1
|
|
income $-1000
|
|
expenses:food $20
|
|
expenses:leisure $15
|
|
expenses:grocery $30
|
|
assets:cash
|
|
>>>
|
|
2016/12/31 expenses:housing $600 $600
|
|
assets:cash $-600 0
|
|
2017/01/01 Forecast transact.. income $-1000 $-1000
|
|
expenses:food $20 $-980
|
|
expenses:leisure $15 $-965
|
|
expenses:grocery $30 $-935
|
|
assets:cash $935 0
|
|
>>>2
|
|
>>>=0
|
|
|
|
# Check that --forecast generates transactions only after last transaction in journal
|
|
hledger register -b 2015-12 -e 2017-02 -f - assets:cash --forecast
|
|
<<<
|
|
2016/01/01
|
|
expenses:fun $10 ; more fireworks
|
|
assets:cash
|
|
|
|
2016/12/02
|
|
expenses:housing $600
|
|
assets:cash
|
|
|
|
~ yearly from 2016
|
|
income $-10000 ; bonus
|
|
assets:cash
|
|
>>>
|
|
2016/01/01 assets:cash $-10 $-10
|
|
2016/12/02 assets:cash $-600 $-610
|
|
2017/01/01 Forecast transact.. assets:cash $10000 $9390
|
|
>>>2
|
|
>>>=0
|