hledger/tests/budget/auto.test
Dmitry Astapov 23f3da4e92 cli: --auto adds automated postings to reports
Ledger-style automated postings, previously supported only by
hledger-budget, have landed as a first-class feature.  The --auto
flag activates them, so that any postings they generate are
included in reports.
2017-11-26 14:57:41 +00:00

79 lines
1.9 KiB
Plaintext

# Add proportional income tax (from documentation)
hledger print -f- --auto
<<<
2016/1/1 paycheck
income:remuneration $-100
income:donations $-15
assets:bank
2016/1/1 withdraw
assets:cash $20
assets:bank
= ^income
(liabilities:tax) *.33 ; income tax
>>>
2016/01/01 paycheck
income:remuneration $-100
income:donations $-15
assets:bank
(liabilities:tax) $-33 ; income tax
(liabilities:tax) $-5 ; income tax
2016/01/01 withdraw
assets:cash $20
assets:bank
>>>2
>>>=0
hledger register -f- --auto
<<<
2016/1/1 paycheck
income:remuneration $-100
income:donations $-15
assets:bank
2016/1/1 withdraw
assets:cash $20
assets:bank
= ^income
(liabilities:tax) *.33 ; income tax
>>>
2016/01/01 paycheck income:remuneration $-100 $-100
income:donations $-15 $-115
assets:bank $115 0
(liabilities:tax) $-33 $-33
(liabilities:tax) $-5 $-38
2016/01/01 withdraw assets:cash $20 $-18
assets:bank $-20 $-38
>>>2
>>>=0
hledger balance -f- --auto
<<<
2016/1/1 paycheck
income:remuneration $-100
income:donations $-15
assets:bank
2016/1/1 withdraw
assets:cash $20
assets:bank
= ^income
(liabilities:tax) *.33 ; income tax
>>>
$115 assets
$95 bank
$20 cash
$-115 income
$-15 donations
$-100 remuneration
$-38 liabilities:tax
--------------------
$-38
>>>2
>>>=0