-X without revaluation

38 views
Skip to first unread message

Martin Michlmayr

unread,
Jun 28, 2011, 3:40:20 PM6/28/11
to ledge...@googlegroups.com
I'm working on my tax return and I have to convert foreign currency
income/expenses transacations at the rate on the date of the
transacation.

-X EUR will produce a total at the current exchange rate, rather than
the historic exchange rate due to "Commodities revalued":

| 12760:tbm@jirafa: ~] ledger -f a.ledger reg -X EUR expenses:
| 2011-01-01 A Expenses:Whatever -11.50 EUR -11.50 EUR
| 2011-02-01 Commodities revalued <Revalued> -1.00 EUR -12.50 EUR
| 2011-02-01 B Expenses:Whatever -12.50 EUR -25.00 EUR
| 2011-03-01 Commodities revalued <Revalued> -2.00 EUR -27.00 EUR
| 2011-03-01 C Expenses:Whatever -13.50 EUR -40.50 EUR

-X EUR -O will not show the "Revalued" transacations but they are still
there if you look at the total.

| 12761:tbm@jirafa: ~] ledger -f a.ledger reg -X EUR -O expenses:
| 2011-01-01 A Expenses:Whatever -11.50 EUR -11.50 EUR
| 2011-02-01 B Expenses:Whatever -12.50 EUR -25.00 EUR
| 2011-03-01 C Expenses:Whatever -13.50 EUR -40.50 EUR

I'm looking to ledger to tell me that the total is 37.50 EUR (11.50 +
12.50 + 13.50). Is this possible?

Is this the old "-X implies -V" problem we discussed before?


ledger file:

D 1000.00 EUR
P 2011-01-01 GBP 1.15 EUR
P 2011-02-01 GBP 1.25 EUR
P 2011-03-01 GBP 1.35 EUR

2011-01-01 * A
Assets:Cash 10.00 GBP
Expenses:Whatever

2011-02-01 * B
Assets:Cash 10.00 GBP
Expenses:Whatever

2011-03-01 * C
Assets:Cash 10.00 GBP
Expenses:Whatever

--
Martin Michlmayr
http://www.cyrius.com/

John Wiegley

unread,
Jun 28, 2011, 4:24:55 PM6/28/11
to ledge...@googlegroups.com
Martin Michlmayr <t...@cyrius.com> writes:

> I'm working on my tax return and I have to convert foreign currency
> income/expenses transacations at the rate on the date of the
> transacation.

You can use -e DATE to report up to a given date, with valuation done as of
that date.

Or you can use --now DATE to valuate anything as if DATE was today.

John

Martin Michlmayr

unread,
Jun 28, 2011, 5:13:08 PM6/28/11
to ledge...@googlegroups.com
* John Wiegley <jo...@newartisans.com> [2011-06-28 15:24]:

> > I'm working on my tax return and I have to convert foreign currency
> > income/expenses transacations at the rate on the date of the
> > transacation.
>
> You can use -e DATE to report up to a given date, with valuation done as of
> that date.
>
> Or you can use --now DATE to valuate anything as if DATE was today.

Right, but neither of those do what I want. What I need is a list of
transactions with the valuation of the date of the transaction (and
without any later revaluation). I think this is a pretty common use
pattern so it would be nice if ledger would support it.

Just to clarify what I'm looking for. Right now, I get this:

| 12761:tbm@jirafa: ~] ledger -f a.ledger reg -X EUR -O expenses:
| 2011-01-01 A Expenses:Whatever -11.50 EUR -11.50 EUR
| 2011-02-01 B Expenses:Whatever -12.50 EUR -25.00 EUR
| 2011-03-01 C Expenses:Whatever -13.50 EUR -40.50 EUR

The individual amounts are correct:
10.00 GBP at 1.15 on 2011-01-01 is 11.50 EUR
10.00 GBP at 1.25 on 2011-02-01 is 12.50 EUR
10.00 GBP at 1.35 on 2011-03-01 is 13.50 EUR
However, the total includes a revaluation. What I'm looking for are
the historical prices on the day of the transaction, and sum those
up, i.e.:

| 2011-01-01 A Expenses:Whatever -11.50 EUR -11.50 EUR

| 2011-02-01 B Expenses:Whatever -12.50 EUR -24.00 EUR
| 2011-03-01 C Expenses:Whatever -13.50 EUR -37.50 EUR

I believe the underlying problem here is that -X implies -V. I've
tried to argue in the past that -X should be decoupled from -V
and this example seems like a good reason why.

John Wiegley

unread,
Jun 28, 2011, 5:17:23 PM6/28/11
to ledge...@googlegroups.com
Martin Michlmayr <t...@cyrius.com> writes:

> Right, but neither of those do what I want. What I need is a list of
> transactions with the valuation of the date of the transaction (and
> without any later revaluation). I think this is a pretty common use
> pattern so it would be nice if ledger would support it.

Ah, this is in the schedule to be done soon, just, need, time...

John

Reply all
Reply to author
Forward
0 new messages