AqBanking mt940 import: Incomplete Account numbers

gnucash at gnucash at
Sun Jan 7 08:24:35 EST 2018

Hi everyone


I sent in a patch for AqBanking last week, that has been adopted by Martin Preuss meanwhile, fixing a problem where AqBanking truncates non-numeric account numbers, leading to problems with the account selection of GnuCash (see below for more details).


My question to the GnuCash developers is:  Do you guys update AqBanking with every release or do I have to file a bug in order to have the changes in AqBanking adopted for GnuCash?


Thank you in advance for your help.





**More details**

After using GnuCash for circa an year now, I frequently had issues importing SWIFT exports from my bank (Raiffeisen Schweiz) into GnuCash:

During an initial import for a given account, GnuCash asked me correctly to select the proper account for the mt940 file. However after doing so, some (not all) SWIFT exports for other accounts have been automatically assigned to this GnuCash account too. 


As a work around I started to create a new account and delete the offending one while assigning the transactions to the one just created.


Now I finally found the time to dig into this problem and realized that AQBanking does not always extract the complete account number from the mt940-file.

My mt940 files started with the following sequence of records:





Where the line beginning with :25: denotes the account number. As my bank’s account numbers are composed in a style like <customerid>.<account>, I had multiple accounts starting with “123456” but different digits after the period.


I found that the account number is truncated by AqBanking at the first occurrence of a non-numeric character. Hence it whenever GnuCash queried the account number, it only got the “customer ID” part, that collides of course with multiple accounts.


Martin Preuss added my patch to the master branch of the git repository. However I don’t know yet what Martin’s release plan is.

More information about the gnucash-devel mailing list