After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746792 - process payment in foreign currency leads to broken equation
process payment in foreign currency leads to broken equation
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Currency and Commodity
2.6.4
Other Linux
: Normal major
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
: 727423 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-03-26 09:26 UTC by max_spam
Modified: 2018-06-29 23:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of problem (49.43 KB, image/png)
2015-03-26 09:26 UTC, max_spam
Details
screenshot of same problem, using GBP and EUR. (60.14 KB, image/png)
2015-06-09 08:57 UTC, Michel Drescher
Details

Description max_spam 2015-03-26 09:26:39 UTC
Created attachment 300340 [details]
screenshot of problem

Trading accounts activated.

After Importing account transaction from CSV,  the assigned accounts are correctly displayed as:

Savings HKD to Currency HKD  700
Currency USD to Liabilities: Accounts Payable: Vendor 100

Exchange rate correct.
exemplary exchange rate and amount 100 USD = 700 HKD

If I click on process payment I am now having:

Liabilities: Accounts Payable: Vendor:  100 USD
Trading: Currency: HKD 700
Liabilities: Accounts Payable: Vendor: 600 USD

Current Assets: Accounts HKD Savings 700 HKD
Trading: Currency: USD 90
adjustment account USD 610
Comment 1 Michel Drescher 2015-06-09 08:55:30 UTC
Bug confirned still existing in gnucash 2.6.6, on Mac OS X Yosemite.

Simple demo account setup, with two currencies, GBP as main accounting currency, and EUR as customer's currency.

First split transaction is the posting of in invoice of 10k EUR with an exchange rate of 0.7 to the Pound Sterling, i.e. showing up as 7k GBP on my Sales income account (Income:Sales:UK) via currency trading accounts. Exchange rate is set manually to 0.7 when posting the invoice.

Second transaction is the (failed) attempt to pay the invoice through the business system. Payment editor asks for payment to be made, with the right amount, in the correct currency (i.e. 10k EUR). I select the payment date, leave the suggested amount (10k EUR) unaltered and ensure that the correct account (Bank:Current Account, in GBP) is selected as the transfer account. Post account is A/Receivable (EUR). Clicking Ok, I then get asked for the exchange rate - and that's where things go wrong: It takes the EUR amount as GBP amount (i.e. 10k GBP) and asks for an exchange rate. I can only change the exchange rates, not the accounts involved nor the moneys amount to be exchanged. Changing the exchange rate to the desired rate (which I get from my bank, not from the open market!) of 0.72 GBP to the EUR, I get the botched transaction as detailed in the screenshot.
Comment 2 Michel Drescher 2015-06-09 08:57:05 UTC
Created attachment 304832 [details]
screenshot of same problem, using GBP and EUR.

screenshot showing the general ledger after posting, and paying an invoice. Posting is done with an exchange rate of 0.7 GBP to the EUR, paying is done with an exchange rate of 0.72 GBP to the EUR.
Comment 3 Geert Janssens 2015-06-13 16:11:14 UTC
I had some time today to look into this.

The bug was easy to reproduce.

It turns out the payment process was not being consistent in interpreting amounts and currencies in case of multi-currency payments.

When a transfer account in a different currency than the post-to account is selected, the amount is interpreted in the currency of the transfer account. However at the same time clicking on a document in the list would fill out the amount fields with the amount of the document, falsely suggesting that amount is in the document's currency.

To get the payment right you had to manually correct the payment amount to match the document's amount in the transfer account's currency.

An example:
Suppose you want to pay a bill of $100 from a bank account in €, with a fictional exchange rate of $1 = €0.80

By clicking on the document the amount field would display 100. This is interpreted in € though because the bank account is in €. So to get it right you manually have to correct the payment amount to 80 ($100*0.80).

Clicking ok then would ask for a conversion rate from € back to USD, for which you'd enter 1/0.80 or 1.25.

And that would lead to a proper creation of the payment transaction. Phew.

As said at the beginning, this is highly confusing and rather backwards as you have to do the actual currency conversion twice as a user - once to manually correct the payment amount and a second time because gnucash asks you for an exchange rate.

So I have reversed most of the logic:
- The payment amount will always be in the document's currency (which happens to be the owner's currency and also the post-to currency).
- When hitting ok, you'll be asked for a conversion rate from that currency to the transfer account's currency
- GnuCash will handle it from there to set up the correct payment transaction.

To avoid any confusion I have changed the payment window to explicitly show the currency used to interpret the amount.

I have tested this both with or without trading accounts and both cases seem work fine for me.

Expect this fix to land in the upcoming gnucash 2.6.7.

Thank you for reporting this bug.
Comment 4 Geert Janssens 2015-06-13 16:21:41 UTC
*** Bug 727423 has been marked as a duplicate of this bug. ***
Comment 5 Michel Drescher 2015-06-13 16:44:35 UTC
Thanks for taking the time fixing this bug.

Related to this, I have the following feature request:

Suppose I want to record a payment from a customer in a foreign currency: My base currency is GBP, but I get paid in EUR onto my GBP account. As usual, banks charge a service fee for conversion, and for each such payments I get a settlement statement detailing the exchange rate and the service charge. I would like to be able to record the service charge *with* the payment instead of either manually adjusting the transaction later, or adding a separate service charge transfer (from current account to service charge expenses.

Example:
I invoice my customer with a fictional 10 kEUR invoice. I get paid, and the bank uses a fictional conversion rate of 0.7 GBP to the EUR. Consequently, the converted GBP amount would be 7 kEUR, but I get credited with only 6,900 GBP since the bank keeps a fictional 100 GBP service charge.

Since I use transfer accounts, the transaction would currently look like this:

Account                |    Credit    |    Debit
-----------------------|--------------|-------------
TRANSFER:Currency:EUR  |  10,000 EUR  | 
Bank:Current Account   |   7,000 GBP  | 
A/R:Customer           |              | 10,000 EUR
TRANSFER:Currency:GBP  |              |  7,000 GBP

However, I would like to be able to create a transaction like this:

Account                   |    Credit    |    Debit
--------------------------|--------------|-------------
TRANSFER:Currency:EUR     |  10,000 EUR  | 
Bank:Current Account      |   6,900 GBP  | 
Expenses:VAT:Bank Charges |     100 GBP  |
A/R:Customer              |              | 10,000 EUR
TRANSFER:Currency:GBP     |              |  7,000 GBP

Cheers,
Michel
Comment 6 John Ralls 2015-06-13 17:18:10 UTC
Please open a new bug for your feature request -- after satisfying yourself that it hasn't been requested already, of course. Closed bugs are seldom looked at.
Comment 7 John Ralls 2018-06-29 23:39:48 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=746792. Please update any external references or bookmarks.