gnucash master: Aqbanking online SEPA transfer: Allow transfers without BIC, only IBAN. Also add IBAN checking.

Christian Stimming cstim at code.gnucash.org
Fri Sep 26 16:27:09 EDT 2014


Updated	 via  https://github.com/Gnucash/gnucash/commit/0b76b52d (commit)
	from  https://github.com/Gnucash/gnucash/commit/bf753402 (commit)



commit 0b76b52dc5856a7d04e61e3d8754e06c691dcb7c
Author: Christian Stimming <christian at cstimming.de>
Date:   Fri Sep 26 22:48:46 2014 +0200

    Aqbanking online SEPA transfer: Allow transfers without BIC, only IBAN. Also add IBAN checking.

diff --git a/src/import-export/aqb/dialog-ab-trans.c b/src/import-export/aqb/dialog-ab-trans.c
index 355c0e8..93d1216 100644
--- a/src/import-export/aqb/dialog-ab-trans.c
+++ b/src/import-export/aqb/dialog-ab-trans.c
@@ -490,6 +490,27 @@ static void
 gnc_ab_trans_dialog_check_ktoblzcheck(const GncABTransDialog *td,
                                       const AB_TRANSACTION *trans)
 {
+    if (gnc_ab_trans_isSEPA(td->trans_type))
+    {
+        int rv = AB_Banking_CheckIban(AB_Transaction_GetRemoteIban(trans));
+        if (rv != 0) {
+            gchar *message = g_strdup_printf(_("The internal check of the destination IBAN '%s' "
+                                               "failed. This means "
+                                               "the account number might contain an error."),
+                                             AB_Transaction_GetRemoteIban(trans));
+            gnc_ab_trans_dialog_entry_set (td->recp_account_entry, message,
+                                           GTK_STOCK_DIALOG_WARNING);
+        }
+        else
+        {
+            gnc_ab_trans_dialog_entry_set (td->recp_account_entry, "",
+                                           NULL);
+            gnc_ab_trans_dialog_entry_set (td->recp_bankcode_entry, "",
+                                           NULL);
+        }
+    }
+    else
+    {
 #ifndef HAVE_KTOBLZCHECK_H
     return;
 #else
@@ -548,6 +569,7 @@ gnc_ab_trans_dialog_check_ktoblzcheck(const GncABTransDialog *td,
     LEAVE("KtoBlzCheck said check is %d = %s",
           blzresult, blztext ? blztext : "(none)");
 #endif
+    }
 }
 
 static void
@@ -633,7 +655,7 @@ gnc_ab_trans_dialog_verify_values(GncABTransDialog *td)
     bankcode = gnc_ab_trans_isSEPA(td->trans_type)
             ? AB_Transaction_GetRemoteBic(td->ab_trans)
             : AB_Transaction_GetRemoteBankCode(td->ab_trans);
-    if (!bankcode || !strlen(bankcode))
+    if (!gnc_ab_trans_isSEPA(td->trans_type) && (!bankcode || !strlen(bankcode)))
     {
         gnc_ab_trans_dialog_entry_set (td->recp_bankcode_entry,
                                        _("You did not enter a recipient bank. A recipient bank is "



Summary of changes:
 src/import-export/aqb/dialog-ab-trans.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list