A posting's cost must be of a different commodity than its amount

80 views
Skip to first unread message

Chris Gray

unread,
Jun 17, 2009, 7:42:58 AM6/17/09
to ledge...@googlegroups.com
Hi,

I am trying to record a transaction and I am getting the error that I
mentioned in the subject line. I think the problem is that I do not use
a currency symbol in general when adding transactions. This is because
my keyboard does not have a Euro symbol, so it is very cumbersome to add
one to each transaction. The transaction is as follows:

2009/06/03 Westjet
Expenses:Transportation:Air C$429.80 @ 1.572865
Expenses:Bank:Fees 2.73
Liabilities:Mastercard

Where 1.572865 is the exchange rate between Canadian dollars and Euros
that was used.

Is there a better way to do this or a workaround?

Cheers,
Chris

John Wiegley

unread,
Jun 17, 2009, 11:34:55 AM6/17/09
to ledge...@googlegroups.com
On Jun 17, 2009, at 12:42 PM, Chris Gray wrote:

> 2009/06/03 Westjet
> Expenses:Transportation:Air C$429.80 @ 1.572865
> Expenses:Bank:Fees 2.73
> Liabilities:Mastercard
>
> Where 1.572865 is the exchange rate between Canadian dollars and Euros
> that was used.
>
> Is there a better way to do this or a workaround?

I'll look into this, but yeah I'd recommend using "2.73 EUR" to
represent transactions in Euros. Ledger does some special thing with
"uncommoditized" amounts, which in some cases may end up surprising you.

John

John Wiegley

unread,
Jun 18, 2009, 11:07:23 AM6/18/09
to ledge...@googlegroups.com
On Jun 17, 2009, at 12:42 PM, Chris Gray wrote:

> Where 1.572865 is the exchange rate between Canadian dollars and Euros
> that was used.
>
> Is there a better way to do this or a workaround?

I see the problem now. This has been fixed in the 'next' branch.

John

Chris Gray

unread,
Jun 18, 2009, 1:02:06 PM6/18/09
to ledge...@googlegroups.com
John Wiegley wrote:

Thanks. In the meantime, I added EUR to the end of all my transactions,
so the problem went away.

Cheers,
Chris

Ben Alexander

unread,
Jul 31, 2009, 1:50:27 AM7/31/09
to ledge...@googlegroups.com
I use three letter currency codes for all my currencies (alas, the
list include USD, EUR, GBP, and RON). Sometimes I add a whole bunch
of transactions to my ledger and notice that I've forgotten to include
the currency. Is there a way to have 'ledger reg' command match only
uncurrencied transactions?

I use ledger-current.dmg.zip for the Mac, but it doesn't come with any
documentation. The v2.6.1 documentation isn't appropriate anymore.
Is there an updated info file for v3.0?

-Ben

John Wiegley

unread,
Jul 31, 2009, 2:05:36 AM7/31/09
to ledge...@googlegroups.com

On Jul 31, 2009, at 1:50 AM, Ben Alexander wrote:

> I use three letter currency codes for all my currencies (alas, the
> list include USD, EUR, GBP, and RON). Sometimes I add a whole bunch
> of transactions to my ledger and notice that I've forgotten to
> include the currency. Is there a way to have 'ledger reg' command
> match only uncurrencied transactions?

Try this: -l '!commodity'

> I use ledger-current.dmg.zip for the Mac, but it doesn't come with
> any documentation. The v2.6.1 documentation isn't appropriate
> anymore. Is there an updated info file for v3.0?

Still working on it.

John

Ben Alexander

unread,
Jul 31, 2009, 6:07:12 AM7/31/09
to ledge...@googlegroups.com
That works great! Thanks!

And by extension, I found a version that will find the transactions
posted in the wrong currency for the account they're in. As in:

./ledger reg -l 'commodity="GBP"' Assets:Checking:US

So I can find the transaction on my bank statement and update with the
appropriate exchange rate. Cool!

Reply all
Reply to author
Forward
0 new messages