AUDIT: r17405 - gnucash/trunk/src/import-export/aqbanking - Handle missing information when importing from aqbanking more gracefully.

Andreas Köhler andi5 at cvs.gnucash.org
Thu Jul 24 19:46:15 EDT 2008


Author: andi5
Date: 2008-07-24 19:46:14 -0400 (Thu, 24 Jul 2008)
New Revision: 17405
Trac: http://svn.gnucash.org/trac/changeset/17405

Modified:
   gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.c
Log:
Handle missing information when importing from aqbanking more gracefully.

The online_id used to match an aqbanking accountinfo to a gnucash account is the
concatenation of the bank code and account number found.  If the primer is NULL,
then fall back to "" instead of invalidating the whole id.

BP


Modified: gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.c	2008-07-24 08:30:52 UTC (rev 17404)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.c	2008-07-24 23:46:14 UTC (rev 17405)
@@ -428,13 +428,16 @@
 static Account *
 gnc_ab_accinfo_to_gnc_acc(AB_IMEXPORTER_ACCOUNTINFO *acc_info)
 {
+    const gchar *bankcode, *accountnumber;
     gchar *online_id;
     Account *gnc_acc;
 
     g_return_val_if_fail(acc_info, NULL);
 
-    online_id = g_strconcat(AB_ImExporterAccountInfo_GetBankCode(acc_info),
-                            AB_ImExporterAccountInfo_GetAccountNumber(acc_info),
+    bankcode = AB_ImExporterAccountInfo_GetBankCode(acc_info);
+    accountnumber = AB_ImExporterAccountInfo_GetAccountNumber(acc_info);
+    online_id = g_strconcat(bankcode ? bankcode : "",
+                            accountnumber ? accountnumber : "",
                             (gchar*)NULL);
     gnc_acc = gnc_import_select_account(
         NULL, online_id, 1, AB_ImExporterAccountInfo_GetAccountName(acc_info),



More information about the gnucash-changes mailing list