Transfer between Accounts with different Currencies

Derek Atkins warlord at MIT.EDU
Wed Mar 12 22:43:57 CST 2003


Frank Burkhardt <fbo2 at gmx.net> writes:

> As soon as debian offers it, i'll get it.

Heh.  jt?  What's the holdup?

> I made a little mistake in my first post. Another try:

ok...

> (*Reality*) 1 EUR = 1.955830 DEM ; 1 DEM = 0.511292 EUR

Right.  This is certainly the number in gnc-euro.c, however....

> There are 2 accounts "DEM" and "EUR", both account's registers are
> empty. I want to transfer 100 DEM from "DEM" to "EUR"
> The "Transfer Funds"-Dialog opens, showing
> 
>  Exchange Rate = 1,955830 (*1*)
>   1 DEM = 1.955830            // Wrong (see (*Reality*) )
>   1 EUR = 0.511292            // Wrong, too
> 
> Gnucash seems to know the correct exchange rate but maybe someone
> exchanged "/" and "*".

Yep.  It looks like they inverted the comparrison.  The rates are
stores in "per EURO", but the code was assuming "per <commodity>",
which obviously works right with EUROs themselves (being 1 ;).  So,
that explains this.  I've now fixed this in CVS, and it will be fixed
in 1.8.3.  If you're REALLY NICE to jt, he might fix it in the debian
release of 1.8.2.

> "DEM"'s balance is DEM -100 now. The status line below the toolbar shows
> 
>  -DEM 100,00 / -51,13 EUR (*2*)

Well, this is correct..  The conversion is supposed to be to 51.13
EURO, and the internal conversions happen correctly.  So, this is
correct.

> which is correct but "EUR"'s balance is EUR 195,58 (*3*) .
> This is wrong according to (*Reality*) but correct according
> to the Exchange Rate in the "Transfer Funds"-Dialog.

This is wrong because of #1.

> Questions:
> 
>  Why is the default exchange rate (*1*) wrong (it should be 0.511292)?
>  Why are (*2*) and (*3*) two different values?

#1 is wrong due to a bug.  #2 and #3 are different because they are
computed differently.  #3 is "computed" directly from the account
balance (which is wrong due to #1).  #2 is actually correct becuase it
is auto-computed internally (and the internal auto-computations got
the "inversion" properly done.

Needless to say, thank you for this report.  It's now been fixed in CVS.

> Regards,
> 
> Frank

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-user mailing list