[I wrote]:
> I'm trying to produce a simplified balance sheet and income/expense
> statement for a set of accounts. [depreciation/revaluation]
> My first try:
> ledger -f ledger.dat -G -X £ --begin $begin bal Assets Liabilities
>
> My second try:
> ledger -f ledger.dat -G -X £ -d "d>=[$begin]" bal Assets Liabilities
> gives me an error
>
> My third try:
> ledger -f ledger.dat -G -X £ -d "d>=[$begin]" reg Assets Liabilities
> Really I'd want my second try to work, to match my mental model of how
> to drive ledger... but maybe that's just me.
Thinking about this some more, I'm less convinced that my second try
should give me what I want, though I think it should probably not error.
What I actually want, I think, is the difference in value at $end and at
$begin in my preferred currency of the current contents of the accounts.
So, I read the overview of format strings, and tried
ledger -f ledger.dat --format "%A %(P(T,[$end],\"£\")-P(T,[$begin],\"£\"))\n"
bal
and it is nearly there. However, for commodities where the first
recorded price is after $begin, this fails. Given the ledger file
below:
--- begin ---
2012/06/01 Foo
Assets:Foo FOO1
Assets:Checking £-1.00
P 2012/09/01 FOO £0.9
2013/02/01 Bar
Assets:Bar BAR1
Assets:Checking £-1.00
P 2013/03/01 FOO £0.95
P 2013/03/01 BAR £1.3
--- end ---
the ledger invocation above produces (reformatted slightly)
Assets:Bar BAR-1 {£1.00} [2013/02/01]
£1.30
Assets:Checking 0
Assets:Foo £0.05
So the Assets:Foo change from commodity fluctuation has correctly been
identified as +£0.05 (1 FOO changing from value £0.9 to £0.95); the
Checking account has correctly been identified as 0. However, this
hasn't worked for the Bar account: the call to P(T,[2013/01/01],"£") for
the BAR1 bought on 2013/02/01 has not successfully converted the
commodity to a market price in £. I think.
What would make this work for me is if the market price for a commodity
before the first price given were the earliest price (or lot price).
Then the BAR1 would be valued on 2013/01/01 as £1, giving a difference
of £0.30, which would be the right answer from the point of view of
commodity fluctuation. My first question is whether this is a sensible
definition of the commodity price at dates earlier than the first price
given, and whether making that definition would break anything. If that
definition is OK, my next question would be how to make that happen...
Thanks,
Christophe
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.