Multi-currency

Timothy Wight tim.wight at kihoe.net
Wed Sep 23 18:34:21 EDT 2009


I would like to put an alternative point of view -- and apologise in 
advance for being long winded.

First of all, let me say that currency trading accounts, implemented 
manually as per Peter Selinger, have saved my bacon for four years of 
business accounts with considerable multi-currency transactions.  I also 
believe that Mikes patch (if it had been available in Windows) would 
have made life implementing them considerably easier. 

BUT, unless I have overlooked some other compelling reason, trading 
accounts are just a work around to avoid the problem of GnuCash 
improperly handling realised and unrealised losses and gains.  This IMHO 
is a bug.  With trading accounts, all currency transactions would take 
four splits and create a lot of extra data, be complicated to edit, and 
reports would be harder to read.  I would much prefer to see the bug 
fixed and take trading accounts as second alternative choice --  and I 
am hopeful the problem could be fixed with a much smaller overhead.

Realised gains and losses,  unlike unrealised ones, have tax 
implications and need to be treated as income or expense, not equity.  
Unrealised and realised gains/losses are handled in the same incorrect 
way, with realised gains either totally ignored omitted or mistaken for 
unrealised gains/losses. 

The errors cannot be put right manually, as an unbalanced transaction is 
needed to correct an imbalance.  However, the error could be corrected 
by the program at year end, by recognising the division between realised 
and unrealised losses in the imbalance it has already detected, and 
posting an appropriate split to a user nominated income/expense account.  

It could more elegantly be corrected by adding a suitably calculated 
gain/loss split to each transaction that realises a loss or gain.  The 
only downside would be that all subsequent equivalent transactions on 
that account would need to be recalculated in the case of a value edit.

To explore the bug follow this simple example  (tested on 2.2.9):

Set up a USD 'Simple Checkbook' file and insert an opening balance of 
$1000 into 'Cash In Wallet'.
Create a 'Current Asset' account 'Canadian Cash' with currency 'CAD 
(Canadian Dollar)'
Create a transaction to transfer USD 200 from 'Cash In Wallet' to 
'Canadian Cash' with an exchange rate of 1.2. dated before today.
'Canadian Cash' should now show a balance of CAD 240, 'Cash In Wallet' 
should show a balance of USD 800.

Create a 'Trial Balance' report and a 'Balance Sheet' report.
The Trial Balance' should balance at *USD 1,000.00 : USD 1,000.00*
The 'Balance Sheet' should show *Total Assets = USD 1,000.00* and *Total 
Equity = USD 1000.00*.
So far so good!

Now, using Tools => Price Editor => Currency => CAD, enter a new 
exchange rate of 1.25.
Reload the 'Trial Balance' report and a 'Balance Sheet' report.
(ensure that 'Nearest In Time' is selected for both reports in Options 
=> Commodities => Price Source and that 'Compute Realised Gains and 
Losses' is selected in Options => General) 

The Trial Balance' will still balance at *USD 1,000.00 : USD 1,000.00

*This is correct.  Although 'Canadian Cash' value has reduced to USD 
192, the report has inserted a balancing line of USD 8.00 categorised as 
'Unrealised Losses'   The 'Balance Sheet' also balances, showing: *Total 
Assets = USD 992.00* and *Total Equity = USD 992.00.**
*
Now create a transfer to move CAD 120.00 from 'Canadian Cash' back to 
'Cash In Wallet' at a rate of 1.25.
 'Canadian Cash' should show a balance of CAD 120.00, 'Cash In Wallet' 
should show a balance of USD 896.00.

Reload the 'Trial Balance' report and a 'Balance Sheet' reports.
The Trial Balance' will still balance at *USD 1,000.00 : USD 1,000.00.**
*Both the Canadian Cash' value has reduced and the USD cash increased by 
USD 96.00  and the balancing line of USD 8.00 categorised as 'Unrealised 
Losses' is still there.

This is wrong!  By transferring funds back to USD we have *realised* USD 
4.00 of the loss and should have an unrealized loss of only USD4.00.  
There should also be an expense entry of USD4.00 as a Realised Loss.  
The 'Balance Sheet' has remained unchanged, still showing an 'unrealised 
loss' of USD 8.00 and therefore incorrect in the same way.

Finally, create another transfer to move the remaining balance from 
'Canadian Cash' to 'Cash In Wallet' at the same rate.
'Canadian Cash' will show a balance of CAD 0.00 and 'Cash In Wallet'  
show a balance of USD 992.00. 
Reload the 'Trial Balance' report and a 'Balance Sheet' report.

The 'Unrealised Losses' line has now disappeared from the 'Trial 
Balance', so it no longer balances at *USD 1,000.00 : USD 992.00. * (It 
would balance if there was a USD 8.00 expense for the realised losses.)

The Balance Sheet is again balanced, with *Total Assets = USD 992.00* 
and *Total Equity = USD 992.00.*
However it still contains an incorrect balancing entry of USD 8.00 
'Unrealised Losses' in Equity, even though there are no longer funds in 
a foreign currency asset account.   The equity entry should read 
'Retained Losses' resulting from a USD 8.00 expense that should have 
been posted as 'Losses From Currency'.

Regards

Tim


Derek Atkins wrote:
> Phil,
>
> I don't know.  I haven't looked at the patch at all so I don't know how
> invasive it is.  It would be nice if 2.4.0 knew how to read/write the
> extra account types, even if it didn't have all the code in there.
>
> I think it's fine to put it into a feature branch to let people test it,
> but I also think that if it's not too invasive, and if it's "off" by
> default, it could possibly go into trunk too.    But as I said I haven't
> looked at it so I don't know how invasive it is.
>
> -derek
>
> Phil Longstaff <plongstaff at rogers.com> writes:
>
>   
>> Derek,
>>
>> how do you see the timing between this patch and 2.3.X/2.4.  Should it go into
>> trunk?  Into a branch?
>>
>> I think I would prefer to see it in a branch to be merged in when 2.4 is
>> released.
>>
>> Phil
>>
>> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
>> From: Derek Atkins <warlord at MIT.EDU>
>> To: Mike Alexander <mta at umich.edu>
>> Cc: gnucash-user at gnucash.org; rsbrux at yahoo.com
>> Sent: Wednesday, September 23, 2009 9:12:09 AM
>> Subject: Re: Multi-currency
>>
>> Mike,
>>
>> Mike Alexander <mta at umich.edu> writes:
>>
>>     
>>> --On September 22, 2009 7:59:32 PM -0700 rsbrux at yahoo.com wrote:
>>>
>>>       
>>>> This sounds very worthwhile to me!
>>>> Why isn't it considered worthy of inclusion in the next stable
>>>> version?
>>>>         
>>> This was discussed on the gnucash-devel list.  See for example the
>>> thread starting with
>>> <https://lists.gnucash.org/pipermail/gnucash-devel/2007-March/020071.html>.
>>>       
>> It's
>>     
>>> probably better if you read the original rather than having me try to
>>> summarize it.
>>>       
>> I think your recent changes make this patch more appropriate for
>> inclusion:  It's off by default, you use a new 'trading account' account
>> type instead of (IMHO incorrectly using Income), ...
>>
>> I think we should look at this more closely now.
>>
>>     
>>>          Mike
>>>       
>>> Please remember to CC this list on all your replies.
>>> You can do this by using Reply-To-List or Reply-All.
>>>       
>> -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
>> _______________________________________________
>> gnucash-user mailing list
>> gnucash-user at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
>>
>>     
>
>   
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.5.409 / Virus Database: 270.13.112/2390 - Release Date: 09/23/09 05:52:00
>
>   


More information about the gnucash-user mailing list