;examples: the hledger manual > Cost reporting examples, and shelltests

This commit is contained in:
Simon Michael 2023-06-28 16:19:41 -10:00
parent c64ffd7fb0
commit c6a721e260
6 changed files with 117 additions and 0 deletions

22
examples/costs/1.j Normal file
View File

@ -0,0 +1,22 @@
2022-01-01
assets:dollars $-135
assets:euros €100
comment
$ hledger -f- print -x --infer-cost --infer-equity
2022-01-01
assets:dollars $-135 @@ €100
equity:conversion:$-€:$ $135
equity:conversion:$-€:€ €-100
assets:euros €100
>=
$ hledger -f- print -x --infer-cost --infer-equity | hledger -f- bal -c '$1.'
$-135 assets:dollars
€100 assets:euros
$135 equity:conversion:$-€:$
€-100 equity:conversion:$-€:€
--------------------
0

22
examples/costs/2a.j Normal file
View File

@ -0,0 +1,22 @@
2022-01-01
assets:dollars $-135
assets:euros €100 @ $1.35
comment
$ hledger -f- print -x --infer-cost --infer-equity
2022-01-01
assets:dollars $-135
assets:euros €100 @ $1.35
equity:conversion:$-€:€ €-100
equity:conversion:$-€:$ $135.00
>=
$ hledger -f- print -x --infer-cost --infer-equity | hledger -f- bal -c '$1.'
$-135 assets:dollars
€100 assets:euros
$135 equity:conversion:$-€:$
€-100 equity:conversion:$-€:€
--------------------
0

22
examples/costs/2b.j Normal file
View File

@ -0,0 +1,22 @@
2022-01-01
assets:dollars $-135
assets:euros €100 @@ $135
comment
$ hledger -f- print -x --infer-cost --infer-equity
2022-01-01
assets:dollars $-135
assets:euros €100 @@ $135
equity:conversion:$-€:€ €-100
equity:conversion:$-€:$ $135
>=
$ hledger -f- print -x --infer-cost --infer-equity | hledger -f- bal -c '$1.'
$-135 assets:dollars
€100 assets:euros
$135 equity:conversion:$-€:$
€-100 equity:conversion:$-€:€
--------------------
0

24
examples/costs/3.j Normal file
View File

@ -0,0 +1,24 @@
2022-01-01
assets:dollars $-135
equity:conversion $135
equity:conversion €-100
assets:euros €100
comment
$ hledger -f- print -x --infer-cost --infer-equity
2022-01-01
assets:dollars $-135 @@ €100
equity:conversion $135
equity:conversion €-100
assets:euros €100
>=
$ hledger -f- print -x --infer-cost --infer-equity | hledger -f- bal -c '$1.'
$-135 assets:dollars
€100 assets:euros
$135
€-100 equity:conversion
--------------------
0

24
examples/costs/4.j Normal file
View File

@ -0,0 +1,24 @@
2022-01-01
assets:dollars $-135
equity:conversion $135
equity:conversion €-100
assets:euros €100 @ $1.35
comment
$ hledger -f- print -x --infer-cost --infer-equity
2022-01-01
assets:dollars $-135
equity:conversion $135
equity:conversion €-100
assets:euros €100 @ $1.35
>=
$ hledger -f- print -x --infer-cost --infer-equity | hledger -f- bal -c '$1.'
$-135 assets:dollars
€100 assets:euros
$135
€-100 equity:conversion
--------------------
0

3
examples/costs/README.md Normal file
View File

@ -0,0 +1,3 @@
Examples/tests for <https://hledger.org/hledger.html#cost-reporting>.
To run the tests: `shelltest *.j`. Last tested with hledger 1.30.