Hi,

I'm using a somewhat old version of ledger, 3.0.2-20140507; if this has
been brought up since May I've missed it.

I like the fact that the --end argument is exclusive; it makes it easy
to build scripts.  Specifically, for a monthly balance sheet, I think I
should be able to do

  echo "Initial balance at $begin"
  ledger -f foo.dat --end $begin Assets Liabilities

  echo "Cash flow"
  ledger -f foo.dat --begin $begin --end $end Income Expenses

  echo "Final balance just before $end"
  ledger -f foo.dat --end $end

However, in the version of ledger that I'm using, this doesn't quite
work as I expect; the difference is when there is price information with
the same date as the $begin date.  Specifically, consider:

--- begin foo.dat ---
P 2013/12/31 FOO $1

2013/12/31 Opening Balance
  Assets:A  1 FOO
  Equity:Ignore

P 2014/01/01 FOO $2
---  end foo.dat  ---

If I do 
  ledger -f foo.dat --end 2014-01-01 -X $ bal Assets

I would expect the output

  $1  Assets:A

because _before_ 2014-01-01 (i.e. treating the 2014-01-01 as completely
excluded) the price of 1 FOO is $1.  However, what I get (with my
version of ledger) I get

  $2  Assets:A

which I assume is because ledger is applying the prices from the end
date to the commodities held in accounts.  I think this is done
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?

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