Use GnuCash Commit 9df290d or a newer version to avoid interference with other problems related to the online banking interface. The issue could be reproduced by following the steps below: 1. Create an Online Banking user based on the HBCI/FinTS backend with the Online Banking Setup Wizard (the issue may also affect other backends). 2. On the page "Match Online accounts with GnuCash accounts" match an Online/AqBanking account (let's call it ABA1 for further reference) with a newly created GnuCash account (let's call it GCA1 for further reference). The issue might occur also with an existing GnuCash account which has never been used before to get transactions or the account balance. 3. Finish the Online Banking Setup and apply your changes. 4. Get transactions or get the account balance for GCA1. 5. After the account data has been retrieved successfully a "Select Account" dialog is shown in order to assign the "Full account ID" or "Online-ID" (which is derived from the properties of the Online account) to a GnuCash account. 6. Now select a different GnuCash account (let's call it GCA2) from the account tree. Usually, this would happen by mistake. 7. Note that the retrieved transactions or the balance are imported to GCA2 and not to GCA1 for which the online retrieval has been started before. 8. Further requests for transactions or the account balances of GCA1 will import the data to GCA2 without asking for a GnuCash account via the "Select Account" dialog anymore. This additional manual assignment of a GnuCash account seems to be superfluous to me and error prone. The assignment should be done automatically based on the matching information from step 2. I will provide a patch of pull request soon which has solved the issue for me. Workaround: In order to correct the misassignment of step 6 you need the delete the Online-ID for GCA2 with the help of the "Import Map Editor" (from the "Tools" menu), request transactions or the account balance for GCA1 again, and select the correct GnuCash account.
Do the following snippets produce different online IDs with your bank? Snippet 1 (from gnc_ab_accinfo_to_gnc_acc at gnc-ab-utils.c line 639) bankcode = AB_ImExporterAccountInfo_GetBankCode(acc_info); accountnumber = AB_ImExporterAccountInfo_GetAccountNumber(acc_info); online_id = g_strconcat(bankcode ? bankcode : "", accountnumber ? accountnumber : "", (gchar*)NULL); Snippet 2 ( from gnc_ab_txn_to_gnc_acc, line 675) bankcode = AB_Transaction_GetLocalBankCode(transaction); accountnumber = AB_Transaction_GetLocalAccountNumber(transaction); online_id = g_strconcat(bankcode ? bankcode : "", accountnumber ? accountnumber : "", (gchar*)NULL);
In my case they don't differ. Are you aware of a situation where they could be different? From my point of view the first snippet gets the info from the properties of AqBanking account, for which transactions have been requested, and the second snippet gets the info directly from the retrieved transactions. Could you confirm this? What about my suggestion in the PR: Calculating the online id already during the online banking account matching within the online banking setup and store it with the GnuCash account already at this time. Would that be a better approach? Of course, the online id should then be also removed from the GnuCash account if the matching is deleted within the online banking account matching.
Yes, that's correct, and yes, I asked that because some FinTS users have reported exactly that problem. https://github.com/Gnucash/gnucash/commit/e991fe853caff678ec23cdeb41e9d1ea87403d6b#diff-7c4a2583d1182b57469949509453904e and https://github.com/Gnucash/gnucash/commit/1c6f3fc957bb3524d0ccbcb11de117bc84c6dab4#diff-7c4a2583d1182b57469949509453904e are attempts to work around the problem but both have known limitations. https://github.com/Gnucash/gnucash/pull/631 is another piece of that effort, addressing some fallout on the OFX DirectConnect side. BTW, could you could test PR631 to make sure it doesn't break FinTS? Merging it is held up by my inability to do that. Before I can endorse an approach to fixing the problem I need a better understanding of what the problem is. As you note in your report, the Online Banking Setup Assistant includes a page for account matching. The fact that you're getting a second match dialog when you do your first import means that something is failing in that first match attempt. My first guess based on your report is that the Assistant isn't setting the KVP online-id slot. Can you confirm that?
Yes, I can confirm this: The Assistant does not set the KVP online-id slot. And that's what I'm currently trying: To let the assistant alread set this slot. Currently, the assistant is only setting the slots hbci/account-id, hbci/account-uid, and hbci/bank-code. Due to the fact that the online-id can be calculated from hbci/bank-code and hbci/account-id the online id seems to be redundant to me, but I can't oversee what is overall depending on this slot. So, I would suggest to keep the online id, but to set and unset it already within account matching step of the Online Banking Setup assistant. I hope that I could provide an updated version of my PR soon, which follows this approach. In parallel, I will also have a look at PR631 and I will try to test it with HBCI/FinTs.
I have just pushed a new version of my PR to github. The automated build checks are still pending. I have also locally merged PR631 on top of my changes. I could successfully build gnucash and also run the check target successfully (all 131 tests have passed). Retrieving transactions from my online account was successful too without the extra account selection dialog. I couldn't test an example with subaccounts because this is not the case for all of my online accounts.
Thanks, the subaccounts feature has already been tested. I'll merge PR 631 soon.
Your fix PR #631 was added to maint and was in version 3.9