* Martin Michlmayr <t...@cyrius.com> [2012-09-29 20:03]:
> > Yet if I leave "$131.38" out, *that's* the amount that Ledger puts into
> > Expenses:Currency Loss for that transaction, automatically.  What gives?
> 
> Thierry and I brought up this issue in the past, see
> http://bugs.ledger-cli.org/show_bug.cgi?id=712

Okay, maybe I was to quick with that.  It seems the problem you run
into is slightly different:

Your example and error:

| 2012/08/03 Venue Payment
|    Assets:GBP Acct    £-3,855.00  {=$1.5893}
|    Assets:Checking    £-6,145.00  {=$1.5552200}
|    Expenses:Venue     £10,000.00  {=$1.5552200}
|    Expenses:Currency Loss    $131.38

gives:

| Unbalanced remainder is:
|              $131.38
| £3,855.00 {=$1.55522}
| £-3,855.00 {=$1.5893}
| Amount to balance against:
|              $131.38
| £10,000.00 {=$1.55522}
| Error: Transaction does not balance

This is a different issue to the one in Bugzilla.  The problem here is
that you have this on one side:
  £-3,855.00  {=$1.5893}
  £-6,145.00  {=$1.5552200}
and this on the other:
  £10,000.00  {=$1.5552200}

To you this may look like the same (i.e. £10k) but since you use
different fixed prices, you actually have different commodities.
£1 {=$1.5893} is not the same as £1 {=$1.5552200} in ledger, and
therefore, adding up £-3,855.00 {=$1.5893} and £-6,145.00
{=$1.5552200} won't give you £10,000.00 {=$1.5552200}.

One way to solve it would simply be to say:

2012/08/03 Venue Payment
   Assets:GBP Acct    £-3,855.00  {=$1.5893}
   Assets:Checking    £-6,145.00  {=$1.5552200}
   Expenses:Venue     £3,855.00  {=$1.5893}
   Expenses:Venue     £6,145.00  {=$1.5552200}

Another solution would be to tell ledger that £1 {=$1.5893} and
£1 {=$1.5552200} are the "compatible", for example like this:

2012/08/03 Venue Payment
   Assets:GBP Acct    £-3,855.00 {$1.5893} @ $1.5552200
   Assets:Checking    £-6,145.00 {$1.5552200} @ $1.5552200
   Expenses:Venue     £10,000.00 {$1.5552200} @ $1.5552200
   Expenses:Currency Loss      $131.38

And here you run into the Bugzilla issue I initially mentioned.
BTW, @ $1.5552200 should probably use the exchange rate of the
day you paid the venue.

I'm not sure which solution is better.  I still haven't quite got my
head around this aspect of ledger.  I hope others can comment (in
particular Thierry who has a lot of experience in this area).

Finally, you may want to use the option --lot-prices together with
ledger bal.  This shows you what's really going on behind the scenes.

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

Reply via email to