mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-24 19:02:46 +03:00
;examples: the hledger manual > Cost reporting examples, and shelltests
This commit is contained in:
parent
c64ffd7fb0
commit
c6a721e260
22
examples/costs/1.j
Normal file
22
examples/costs/1.j
Normal 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
22
examples/costs/2a.j
Normal 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
22
examples/costs/2b.j
Normal 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
24
examples/costs/3.j
Normal 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
24
examples/costs/4.j
Normal 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
3
examples/costs/README.md
Normal 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.
|
Loading…
Reference in New Issue
Block a user