GNOME Bugzilla – Bug 658494
Multi-currency splits don't work with Trading Accounts
Last modified: 2018-06-29 23:00:56 UTC
Created attachment 195916 [details] Screenshots comparing Trading Accounts OFF and ON This bug occurs when inputting a transaction with splits in more than one currency using Trading Accounts. Steps to replicate: Create a new file (base currency GBP) with the following accounts: Assets:GBP Bank - Bank account, currency GBP Assets:USD Bank - Bank Account, currency USD Expenses:Bank Charges - Expense (currency GBP by default). Input the following transaction into the register for GBP Bank: Withdrawal of GBP 10,000, split Assets:USD Bank 9950 (exchange rate dialog comes up, enter exchange rate *) Expenses: Bank Charges 50 With Trading accounts OFF this works, but with Trading Accounts ON you end up with a horrible mess and an Imbalance account being created. It seems to lose the ability to remember the correct currency of the split - i.e. the GBP 9950 is not converted to USD at the input exchange rate, so when the transaction is entered there is an imbalance created caused by the currency conversion failing, so the USD Bank account gets a balance of USD 9950. * when using trading accounts the exchange rate is inverted compared with not using trading accounts so use 1.60 in the non-trading Account version, 0.625 with Trading Accounts. Attached is an image with 2 screenshots of a General Ledgers - the top one is Trading Accounts OFF, the bottom one is ON. This should make the problem clearer.
I have encountered this also with fund transactions - so it seems to be anything where there is a cross-commodity split transaction. For example a transaction where an amount of cash is transferred to a bank account, but is split into two lots at different prices in the fund account. There is no way to input this transaction correctly. The bank account needs one amount, the fund account needs two. Can't be done. The workaround I have devised is to create an imaginary 'Split handler' account, and wash the transaction through that. Eg: Sell 500 units at 2.1 = £1050 Sell 500 units at 2.2 = £1100 Bank receives £2150 (single payment) So I put all three parts through the split handler account. The disadvantage, apart from the extra effort, is that you can't see the full transaction without going into the split handler account i.e. you can't see which bank the money went to from the fund account, all you see is the split handler. I would appreciate if this could be investigated as this situation is far from ideal. Thanks.
With 2.4.8 the problem seems *partly* solved. In fact it seems that I _can_ enter the split and the currency is converted correctly, with the currency trading transactions being added automatically. However, with this split transaction present the balance report is broken, not showing numbers any longer (for total assets, etc.) Even after removing the split transaction, the balance report is still messed up. - Stefan
Had another look and am still getting the same behaviour in 2.4.8 as my previous comments. It seems to convert the split amount to the other currency/commodity within the transaction input instead of remaining in the original currency/commodity, which then causes an imbalance to be created.
Update: With a Fund I have managed to make a transaction as described in Comment 1 - it appears as two transactions on the single line view of the fund register, but is really the same split (which looks wrong but seems on closer inspection OK). Previously I hadn't been able to do that. However, the currency transaction bug is definitely still there - I cannot input a cross currency split without the transaction amounts going wrong and imbalances being created.
I think I see the point now, and in fact I do also have the same problem here. To summarize: When entering a transaction in split view, numbers are interpreted in the currency of the account the transaction is going to, where I would expect the same currency as the current account. This leads to the fact that the exchange rate dialog is presented in the wrong way and also results in the Imbalace account showing up. It would be nice if a developer could comment on this (whether this might by feature not a bug?)...
About the exchange rate dialog there was a fix in Bug 683222 - Rounding Error in Trading Accounts. If somebody of you can checkout and test svn r22383 or newer.
I just tried the steps in the description of this bug and it worked fine, although it is a bit confusing. The key to understanding how this works is to remember that when trading accounts are turned on, the credit and debit amounts entered for each split are in the currency (or other commodity) of the split, not the currency of the transaction. This means that when you enter the amount in the USD split it should be the amount in USD, not the amount in GPB. Then when the exchange rate dialog comes up you can enter the GBP amount in it. If you do it that way it seems to work ok. You get a hint that this is the case because the credit or debit amount will have a currency symbol if it is not the transaction currency. If trading accounts are off all credit and debit amounts are in the transaction currency, but this doesn't work well if they are on. The ideal solution is to, at least optionally, show both amounts, but that will have to wait for the rewrite of the register code that is underway. To be precise I did these steps: First split: account GBP bank, amount 10000 Second split: account USD bank, amount 15000 Got an exchange rate dialog when tabbing out of that split Entered target amount of 9950 Third split: account Bank Charges, amount 50 I was testing the current development version, but I don't think this changed since 2.4 except that the target amount in the exchange rate dialog is set correctly when the dialog is first opened. This is not relevant in this case since there is no pre-existing exchange rate in this file.
(In reply to comment #7) > I just tried the steps in the description of this bug and it worked fine, > although it is a bit confusing. The key to understanding how this works is to > remember that when trading accounts are turned on, the credit and debit amounts > entered for each split are in the currency (or other commodity) of the split, > not the currency of the transaction. This means that when you enter the amount > in the USD split it should be the amount in USD, not the amount in GPB. Then > when the exchange rate dialog comes up you can enter the GBP amount in it. If > you do it that way it seems to work ok. You get a hint that this is the case > because the credit or debit amount will have a currency symbol if it is not the > transaction currency. If trading accounts are off all credit and debit amounts > are in the transaction currency, but this doesn't work well if they are on. > The ideal solution is to, at least optionally, show both amounts, but that will > have to wait for the rewrite of the register code that is underway. > > To be precise I did these steps: > > First split: account GBP bank, amount 10000 > Second split: account USD bank, amount 15000 > Got an exchange rate dialog when tabbing out of that split > Entered target amount of 9950 > Third split: account Bank Charges, amount 50 > > I was testing the current development version, but I don't think this changed > since 2.4 except that the target amount in the exchange rate dialog is set > correctly when the dialog is first opened. This is not relevant in this case > since there is no pre-existing exchange rate in this file. I have tested the above example on 2.4.11, and after a couple of attempts have managed to do this. Put the GBP amounts in the GBP account splits and the USD amount in the USD account split (not the GBP amount which the non-Trading Accounts version expects), then in the exchange rate dialog, enter the GBP amount - note the USD amount in this example is 14,925 not 15,000. The disadvantage is you have to calculate the USD amount before getting to the exchange rate dialog - i.e. you already have to know it's USD and work the amount out... So where does this leave us? The transaction can be created with some careful work, but in a different way depending on whether you are using Trading Accounts, and you have to manually do the work of the exchange rate dialog before you get to see it. Is it worth adding a 'Things to note when using Trading Accounts' section to the FAQ? I'd be happy to assist with that if I were thought to be a good idea (assuming I could work out how to do that)...
Re #c8 Ian, IMHO it will probably become to complex for the FAQ. So I started a fresh wiki page http://wiki.gnucash.org/wiki/Trading_Accounts -linked to the documentation section of the main page. Can you there write down everything you know or watched about the trading accounts? I will reassign this bug to the Documentation team. When wiki/Trading_Accounts has some substantial content, it should become part of the official documentation. Then this bug should be closed.
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Only assigning to default.
GnuCash bug tracking has moved to a new Bugzilla host. The new URL for this bug is https://bugs.gnucash.org/show_bug.cgi?id=658494. Please continue processing the bug there and please update any external references or bookmarks.