Actually no :( On Sat, Sep 17, 2016 at 4:56 PM Travis Laporte <travislapo...@gmail.com> wrote:
> Were you able to find a workaround for this? I am running into the same > issues with this use case. > > > On Thursday, 10 March 2016 08:22:39 UTC-5, Jakob Mattsson wrote: >> >> Hi! >> >> I've read up on the valuation function, but it doesn't seem to behave the >> way the documentation is describing it. >> >> I have this for example: >> >> P 2016-01-01 £ 1.2 $ >> P 2016-01-05 £ 1.4 $ >> >> 2016-01-03 >> SomeAsset £ -100 >> SomeExpense £ 100 >> >> Now, running ledger balance -X $ gives me >> >> $ -140 SomeAsset >> >> $ 140 SomeExpense >> >> >> Just as the documentation mentions, I don't want the expense to be >> re-valuated to $140 on the fifth; I want it to remain $120, which was the >> price is $ at the time of the purchase. So, to quote the docs: >> >> >> *Or how about never re-valuating commodities used in Expenses, since they >> cannot have a different future value:* >> >> *= /^Expenses:/* >> >> * ; VALUE:: market(amount, post.date, exchange)* >> >> *This says the future valuation is the same as the valuation at the time >> of posting. post.date equals the posting’s date, while just ’date’ is the >> value of --now DATE (defaults to today).* >> >> >> >> Ok, so I try this inline, to make it as simple as possible: >> >> P 2016-01-01 £ 1.2 $ >> P 2016-01-05 £ 1.4 $ >> >> 2016-01-03 >> SomeAsset £ -100 >> SomeExpense £ 100; VALUE:: market(amount, post.date, exchange) >> >> Now running ledger balance -X $ gives me: >> >> $ -140 SomeAsset >> >> $ 12000 SomeExpense >> >> The expense has clearly been computed using 1.2 rather than 1.4, which is >> what I wanted, but it's 100 times too large! Why? I've been fiddling with >> this for quite a while now and can't understand what is going on. >> >> Thanks you all! >> >> -- > > --- > You received this message because you are subscribed to a topic in the > Google Groups "Ledger" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ledger-cli/dc6F-HvZOyE/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > ledger-cli+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.