Martin Michlmayr <[email protected]> writes:

> * Christophe Rhodes <[email protected]> [2014-08-01 11:34]:
>> consistently (i.e. there's no failure in accounting) but it's surprising
>> to me that a price with a date of this month ends up affecting last
>> month's balance sheet.  Am I the only one who's surprised, or could the
>> price date handling be changed to be handled like transactions,
>> exclusively with --end?
>
> You have to add --now 2013-12-31
>
> I think --end just limits transactions but not revaluations, but --now
> gives ledger a current date which will cause it to stop revaluations
> at that date.

I think it does limit revaluations, but just with one day's offset.  If
I add

P 2014/01/02 FOO $5

at the end of my example file, and specify --end 2014-01-01, the balance
is reported as $2, not $5.  (In other words, this feels like a classic
fencepost, but for all I know there's an accounting reason it is the way
it is)

> I agree this is not quite intuitive but this is how it is (at the
> moment).

Thanks.  OK.  I am now even more confused:

csr21@aleph-null:/tmp$ ledger -f foo.ledger --end 2014-01-01 --now 2013-12-31 
-X $ bal Assets
                  $1  Assets:A
csr21@aleph-null:/tmp$ ledger -f foo.ledger --now 2013-12-31 --end 2014-01-01 
-X $ bal Assets
                  $2  Assets:A

That is, simply swapping the order of command-line arguments gives
different answers.  Argh, is it possible that the end and now arguments
affect the same internal structure?  Yes, parent->terminus.

So I think that --end 2014-01-01 --now 2013-12-31 has the semantics I
want, setting the ledger epoch and parent->terminus to 2013-12-31, while
limiting transactions to those before 2014-01-01 -- but this feels very
fragile to me, and certainly the fact that I get a different answer with
the arguments the other way round screams that something's not quite
designed right...

I would be happy to work on a patch to adjust --end's behaviour to match
up with my expectations (effectively adding the --now argument
implicitly).  But before I do, I'll wait to hear an explanation of the
current design, or users of --end who are happy the way it currently
interacts with prices.

Cheers,

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/d/optout.

Reply via email to