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 583155 - Invoice creation and posting silently inserts zero amounts when currencies conflict, no error message
Invoice creation and posting silently inserts zero amounts when currencies co...
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Business
2.2.x
Other All
: Normal normal
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
: 430187 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-05-19 04:25 UTC by Jim DeLaHunt
Modified: 2018-06-29 22:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Document with invoice in currency conflict, posted as zero (6.46 KB, application/xml)
2009-05-19 04:29 UTC, Jim DeLaHunt
Details

Description Jim DeLaHunt 2009-05-19 04:25:54 UTC
Please describe the problem:
GnuCash only allows one currency per invoice, and it takes that currency from the Currency setting of the Customer entry with which the invoice is created.  All accounts referenced by the line items of the invoice, including Accounts Receivable, income and expense accounts, etc, must all use that same currency. If the currency differs, then there is a "currency conflict".

The current behaviour of GnuCash is to fail silently when there is a currency conflict, and to post values of zero to each account referenced by the invoice. This causes confusion.  

It would be better if GnuCash would produce a clear error message as soon as a currency conflict becomes apparent, which means at invoice creation time. 
Witness the FAQ http://wiki.gnucash.org/wiki/FAQ#Q:_Posting_invoice_or_bill_results_in_zero_value_transaction_in_Accounts_Payable_or_Accounts_Receivable_-_why_and_how_to_fix_this.3F , and bug Bug 430187 – Posting an invoice returns Zero values to the ledgers with NZD currency - http://bugzilla.gnome.org/show_bug.cgi?id=430187 .



Steps to reproduce:
1. Default Business chart of accounts
2. Create a Customer. Assign that customer one currency, e.g. USD
3. Create an Accounts Receivable account and an Income:Sales account, and set them to a different currency, e.g. CAD. 
4. Create an invoice using the customer (USD) and the A/R and Sales accounts (CAD), for some non-zero amount. This creates a currency conflict.  
5. Post the invoice.


Actual results:
At step 4, there is no error message, despite the presence of the currency conflict.
After step 5, there are transactions in the A/R and Sales accounts from the posted transaction. However, they have amounts of zero instead of the entered value.

Expected results:
At step 4, I expect a a clear error message as soon as a currency conflict becomes apparent. This error message should say what the invoice's currency is, and that an invoice may have only one currency, and that at least one account reference by the invoice uses a different currency.  It would be nice if the error message would point out which line items reference differing currencies. It would be nice if the error message recognised the case where all the line items were the same but different from the customer's currency setting, because it indicates the likely error is that the Customer value is set wrong.

At step 5, there should be an error message, and GnuCash should refuse to post the invoice until the currency conflict is cleared.

It may be desirable to prevent the user from selecting any account with the wrong currency.  However, the invoice entry UI must have some way of signalling why some accounts are blocked. This is particularly true of the user doesn't realise that the Customer entry has a different currency than the Invoice uses.

Does this happen every time?
Yes, absolutely consistent.

Other information:
Bug 430187 reports the same symptoms.

I will upload a sample document, from Bug 430187, which demonstrates the problem. Unpost the invoice in that document, edit the contents, and re-post, to see the bug manifested.
Comment 1 Jim DeLaHunt 2009-05-19 04:29:01 UTC
Created attachment 134913 [details]
Document with invoice in currency conflict, posted as zero

Gnucash document (XML). Reused from bug430187.
Comment 2 Jim DeLaHunt 2009-05-19 04:36:44 UTC
I encountered this problem because I have single clients whom I invoice in multiple currencies. I bill some expenses in USD, some in CAD. They likewise pay in either currency, as convenient.
 
The workaround is to create a different Customer entry for each Currency you use with that customer.
Comment 3 Geert Janssens 2009-12-09 17:31:46 UTC
*** Bug 430187 has been marked as a duplicate of this bug. ***
Comment 4 Geert Janssens 2009-12-09 18:08:31 UTC
I have just tested this with GnuCash built from trunk (revision 18474, somewhere between release 2.3.7 and 2.3.8).

Things seem to have changed in this development version:
1. You can create customers/vendors with a different currency than default, but you can only post an invoice to an account that has the same currency. So it is no longer possible to post a USD invoice to a CAD post account for example.
2. You can add lines on your invoice with accounts in a different currency than the default invoice currency. This was possible before also. However, when posting, GnuCash detects this, and will ask for a conversion rate for each such line.
3. The invoice seems to get posted properly with USD splits in the 'USD A/R' account and CAD splits in the Income and GST accounts.
4. When I pay the invoice, it will show the USD amount in the payment window. If you select a CAD transfer account, again, GnuCash will ask for a conversion rate.
5. The payment splits seem to show up properly in all the respective accounts.

I only encountered one glitch:
When I accidentally unposted the invoice, and reposted it again, the same message popped up to inform me that a conversion rate would be asked, but this didn't happen. So there seems to be no way to correct the conversion rate once it's entered.
Comment 5 Geert Janssens 2013-12-05 10:57:40 UTC
I have improved the invoice posting code such that it now will only pop up the message when the code is really about to ask for a conversion rate. It won't shown at all anymore if no conversion rate will be asked.

This has been committed with some other improvements to this area in the current development branch (r23491).

This improvement will first appear in GnuCash 2.6.0.
Comment 6 John Ralls 2018-06-29 22:21:56 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=583155. Please update any external references or bookmarks.