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 747377 - Cannot enter Letters in IBAN for SEPA transaction
Cannot enter Letters in IBAN for SEPA transaction
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: General
2.6.5
Other Linux
: Normal normal
: ---
Assigned To: gnucash-general-maint
gnucash-general-maint
Depends on:
Blocks:
 
 
Reported: 2015-04-05 16:36 UTC by Burkhard Hoche
Modified: 2018-06-29 23:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Burkhard Hoche 2015-04-05 16:36:52 UTC
A Netherland IBAN can contain letters but I cannot enter them, only the country code.

http://www.iban-bic.com/sample_accounts.html

I think in some older version that was working but not for 2.6.5 and 2.6.6
Comment 1 John Ralls 2015-04-05 16:48:40 UTC
Where exactly are you trying to enter this?
Comment 2 Burkhard Hoche 2015-04-05 17:07:45 UTC
Menu Aktion->Online Aktion->SEPA Einzelüberweisung

sorry don't know the english translation

There was a version where you could enter lowercase letters and there I was able to enter correct IBAN.
Comment 3 Christian Stimming 2015-04-08 20:46:54 UTC
The bug report is correct. I modified the input filter of the respective IBAN text entry box in 8edb303143 (2014-09-01) to allow only two alphabetic characters in the beginning, then only numeric numbers for the rest. As the link in comment #0 says, this is correct for IBANs of the most countries such as Germany, but not for some, such as from the Netherlands. Hence, the gnc_ab_trans_dialog_ibanentry_filter_cb() has to be changed to allow alphas depending on the initial country code in the respective places. 
http://en.wikipedia.org/wiki/International_Bank_Account_Number#Structure

Currently it implicitly allows only the German form, but this should be changed so that by default it allows arbitrary alphanumeric characters, and impose additional constraints only for known country codes in the beginning such as Germany's "DE".
Comment 4 John Ralls 2015-04-09 00:27:05 UTC
Christian, is there an issue with sending an incorrectly-formatted IBAN other than that it will fail? Seems excessively complex to localize the filter unless there's a good reason to.
Comment 5 Burkhard Hoche 2015-04-09 08:50:36 UTC
Before Christian modified the input filter my Deutsche Bank did not accept any IBAN with lower case letters. Maybe the simplest way is just to make all letters uppercase and remove all whitespaces.
Is there any check for correct IBAN in gnucash?
Comment 6 John Ralls 2015-04-09 14:25:23 UTC
(In reply to Burkhard Hoche from comment #5)
> Before Christian modified the input filter my Deutsche Bank did not accept
> any IBAN with lower case letters. 

It still doesn't. The filter function just uppercases the first two characters for you.

> Maybe the simplest way is just to make all
> letters uppercase and remove all whitespaces.

Yes, that seems reasonable.

> Is there any check for correct IBAN in gnucash?

The only check is the one we're discussing here, and it's wrong. Only the bank can determine if the IBAN is correct; the best GnuCash could do is to ensure that it is in a valid format for the country code. Even doing that is quite complicated and as Christian points out must be tailored per-country. The wikipedia article says that there are 57 countries now using IBANs. That's likely to grow and it would be a maintenance headache to keep up. I think the uppercase-and-no-spaces rule you propose above is as far as we should go.
Comment 7 Burkhard Hoche 2015-04-09 15:08:49 UTC
(In reply to John Ralls from comment #6)
> (In reply to Burkhard Hoche from comment #5)
> > Is there any check for correct IBAN in gnucash?
> 
> The only check is the one we're discussing here, and it's wrong. Only the
> bank can determine if the IBAN is correct; the best GnuCash could do is to
> ensure that it is in a valid format for the country code. Even doing that is
> quite complicated and as Christian points out must be tailored per-country.
> The wikipedia article says that there are 57 countries now using IBANs.
> That's likely to grow and it would be a maintenance headache to keep up. I
> think the uppercase-and-no-spaces rule you propose above is as far as we
> should go.
Checking if a IBAN is correct by country code is a big headache but it is possible to validate a given IBAN:

http://en.wikipedia.org/wiki/International_Bank_Account_Number#Validating_the_IBAN

I think that would be a nice feature
Comment 8 Christian Stimming 2015-04-12 20:34:38 UTC
Fixed in c46c0a9e7 (today) for the unstable series. The patch should apply cleanly in "maint", too, but I would like to hear some 1-2 weeks of feedback whether this still works.

As for the discussion above: John, this is not your area of expertise. Please refrain from overly bold statements about the things that are happening and that should happen. Thanks.

As for IBAN validation: The validation itself is already implemented in 
gnc_ab_trans_dialog_verify_values() and gives the user immediate feedback by the icon next to the number (it changes from "invalid" to "valid" once the focus moves to the next field).

The bug here concerns the additional input filter that filtered out everything that to my knowledge shouldn't appear in an IBAN. Alas, contrary to my initial idea the specification didn't restrict numerics vs. alpha-numerics as clearly as I thought for the IBAN, except for position 1 and 2 (alpha) and 3 and 4 (numeric), but only for some countries it is clear. This is now implemented correctly.
Comment 9 Frank H. Ellenberger 2015-04-14 00:21:51 UTC
Christian, why do you not just use the checks from iban.h in libktoblzcheck1-devel?
Comment 10 John Ralls 2018-06-29 23:40:10 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=747377. Please update any external references or bookmarks.