2010-04-16 02:59:22 +04:00
|
|
|
# draft pricing tests
|
|
|
|
# 1. print a transaction with explicitly-priced amount
|
2010-05-22 04:52:45 +04:00
|
|
|
bin/hledger -f- print
|
2010-04-16 02:59:22 +04:00
|
|
|
<<<
|
|
|
|
2009/1/2 x
|
|
|
|
expenses:foreign currency €100 @ $1.35
|
|
|
|
assets
|
|
|
|
>>>
|
|
|
|
2009/01/02 x
|
|
|
|
expenses:foreign currency €100 @ $1.35
|
|
|
|
assets $-135.00
|
|
|
|
|
|
|
|
# 2. again, this time converting to cost basis
|
2010-05-22 04:52:45 +04:00
|
|
|
bin/hledger -f- print -B
|
2010-04-16 02:59:22 +04:00
|
|
|
<<<
|
|
|
|
2009/1/2 x
|
|
|
|
expenses:foreign currency €100 @ $1.35
|
|
|
|
assets
|
|
|
|
>>>
|
|
|
|
2009/01/02 x
|
|
|
|
expenses:foreign currency $135.00
|
|
|
|
assets $-135.00
|
|
|
|
|
|
|
|
# 3. same as above, but using a historical price directive
|
2010-05-22 04:52:45 +04:00
|
|
|
bin/hledger -f- print
|
2010-04-16 02:59:22 +04:00
|
|
|
<<<
|
|
|
|
P 2009/1/1 € $1.35
|
|
|
|
|
|
|
|
2009/1/2 x
|
|
|
|
expenses:foreign currency €100
|
|
|
|
assets
|
|
|
|
|
|
|
|
>>>
|
|
|
|
2009/01/02 x
|
|
|
|
expenses:foreign currency €100 @ $1.35
|
|
|
|
assets €-100 @ $1.35
|
|
|
|
|
|
|
|
# 4. and with conversion
|
2010-05-22 04:52:45 +04:00
|
|
|
bin/hledger -f- print -B
|
2010-04-16 02:59:22 +04:00
|
|
|
<<<
|
|
|
|
P 2009/1/1 € $1.35
|
|
|
|
|
|
|
|
2009/1/2 x
|
|
|
|
expenses:foreign currency €100
|
|
|
|
assets
|
|
|
|
|
|
|
|
>>>
|
|
|
|
2009/01/02 x
|
|
|
|
expenses:foreign currency $135.00
|
|
|
|
assets $-135.00
|
|
|
|
|