tutorial on multi-currency accounting

Mike Alexander mta at umich.edu
Wed Mar 7 16:07:08 EST 2007


--On March 7, 2007 9:50:00 AM -0500 Derek Atkins <warlord at MIT.EDU> 
wrote:

> Mike Alexander <mta at umich.edu> writes:
>
>> The transaction balancing code in xaccTransGetImbalance assumes all
>> exchange rates are correct.  A transaction involving more than one
>> commodity has an implied exchange rate between the commodities which
>> can be determined by comparing the amount and value fields of the
>> various splits.  This is used to create the new splits to balance
>> the  individual commodity amounts in the transaction.  The bottom
>> line is  that the balancing split will be created using the exchange
>> rate  specified when the transaction was entered which I think is
>> the best we  can do.
>
> If a user later goes back and changes the exchange rate, will your
> scrubber update the balancing splits?

Do you mean change the exchange rate in that transaction or the 
exchange rate in the price DB?  If you mean the exchange rate in that 
transaction, then you (be definition) are change some of the values or 
amounts in some of the splits and the scrubber will try to fix things 
up.  This isn't something that you would expect people to do often 
since it means they made a mistake entering the transaction initially, 
and the scrubber might not make the optimal adjustment although it 
should make things valid.

If you mean change the exchange rate in the price DB, then no it won't 
change the transaction, because that's not what you want to do.  The 
transaction accurately describes the initial conversion from one 
currency to another.  The Currency account accurately describes the 
unrealized gain/loss resulting from this transaction (if the price DB 
is up to date).  If you later convert some of the money back in the 
other direction a new transaction will be entered which describes that. 
This will affect not only the asset accounts containing the currencies 
but also the currency trading accounts.  The net effect will be to 
change some or all of the unrealized gain/lost into a realized 
gain/loss at that time.  This is described fairly well in Peter's 
tutorial.

       Mike




More information about the gnucash-devel mailing list