diff --git a/examples/costs/1.j b/examples/costs/1.j new file mode 100644 index 000000000..635071311 --- /dev/null +++ b/examples/costs/1.j @@ -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 diff --git a/examples/costs/2a.j b/examples/costs/2a.j new file mode 100644 index 000000000..05e2b3ccb --- /dev/null +++ b/examples/costs/2a.j @@ -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 diff --git a/examples/costs/2b.j b/examples/costs/2b.j new file mode 100644 index 000000000..f74d2e0bf --- /dev/null +++ b/examples/costs/2b.j @@ -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 diff --git a/examples/costs/3.j b/examples/costs/3.j new file mode 100644 index 000000000..8c6049b2a --- /dev/null +++ b/examples/costs/3.j @@ -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 diff --git a/examples/costs/4.j b/examples/costs/4.j new file mode 100644 index 000000000..17eb515bf --- /dev/null +++ b/examples/costs/4.j @@ -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 diff --git a/examples/costs/README.md b/examples/costs/README.md new file mode 100644 index 000000000..1cdedd570 --- /dev/null +++ b/examples/costs/README.md @@ -0,0 +1,3 @@ +Examples/tests for . + +To run the tests: `shelltest *.j`. Last tested with hledger 1.30.