[GNC] Weird behavior of gnucash-aqbanking account mappings
Peter Zimmerer
pkzw at web.de
Sun Feb 16 14:25:23 EST 2020
Hi all,
I have tested online banking with fints pin/tan this weekend for a quite
recent gnucash version (e.g commit b23d244 from maint, aqbanking 6.1.0,
gwenhywfar 5.2.0) and have found some weird behavior with the
gnucash-aqbanking account mappings.
In order to reproduce this behavior please create a new gnucash file
with at least two bank accounts (e.g. with account names "Account1" and
"Account2").
In order to analyze the effects on the gnucash file I would recommend to
save the gnucash file in sqlite3 format and to watch the changes on the
account-releated entries in table slots with the help of the attached
shell script (requires sqlite3). For this purpose just call
...$ watch SCRIPT_NAME GNUCASH_FILE
at console level.
Now proceed with the online banking wizard as follows:
1. Create an aqbanking user with at least one online bank account.
2. Proceed to the "Match Online accounts with GnuCash accounts" page of
the online banking wizard and link the aqbanking account to the
first gnucash account (e.g. Account1).
3. Proceed to the final page of the wizard and apply your changes.
This will show an output from the script similar to the following:
obj_guid acc_name slot_name s slot_value
---------- -------- -------------------- - -----------------
34a7f42... Account1 hbci 9 ad00640...
ad00640... hbci/account-id 4 XXXXXXXXX
ad00640... hbci/account-uid 1 2
ad00640... hbci/bank-code 4 50010060
In this case the gnucash account with name "Account1" and identified
by guid 34a7f42... has got three attributes from the aqbanking
account:
- 'hbci/account-id', which is just the account number,
- 'hbci/account-uid ' the unique account id of this bank account
in aqbanking, and
- 'hbci/bank-code' the bank code of the account
(German Bankleitzahl).
This is information is used for the (first) online retrieval of
the balance or transactions of this gnucash account.
4. Open the first gnucash account (e.g. Account1)
5. Request its account balance by online action "Get Balance"
6. A "Select Account" dialog will appear and you are requested once
more to assign the retrieved balance to a gnucash account.
Select the first gnucash account (e.g. Account1).
7. Reply with "No" to the "Reconcile account now?" question.
Now the output from the script should look like the following one:
obj_guid acc_name slot_name s slot_value
---------- -------- -------------------- - -----------------
34a7f42... Account1 hbci 9 7ec08f4...
7ec08f4... hbci/account-id 4 XXXXXXXXX
7ec08f4... hbci/account-uid 1 2
7ec08f4... hbci/bank-code 4 50010060
34a7f42... Account1 online_id 4 50010060XXXXXXXXX
Please note that a new slot attribute with name 'online_id',
which seems to be the concatenation of the bank code and
the account number, has been assigned to the first gnucash account.
This looks somehow redundant to me because this information is
already covered by the other (hbci) slot values.
8. Open the "Online Banking Wizard" again and proceed to the
"Match Online accounts with GnuCash accounts" page.
Please note that the previous assignment of the gnucash account
is no longer shown on this page (see also remark below).
9. Double-click on the same aqbanking account as in step 2, but now
link it to the second gnucash account (e.g. Account2).
10. Proceed to the final page of the wizard and apply yout changes.
Now the output from the script will look like this:
obj_guid acc_name slot_name s slot_value
---------- -------- -------------------- - -----------------
34a7f42... Account1 hbci 9 056b1cb...
056b1cb... hbci/account-id 4 XXXXXXXXX
056b1cb... hbci/account-uid 1 2
056b1cb... hbci/bank-code 4 50010060
34a7f42... Account1 online_id 4 50010060XXXXXXXXX
aa18bf8... Account2 hbci 9 0291dfe...
0291dfe... hbci/account-id 4 XXXXXXXXX
0291dfe... hbci/account-uid 1 2
0291dfe... hbci/bank-code 4 50010060
Please note that now both gnucash accounts have got assigned to
the same aqbanking account via the 'hbci/...' slot attributes.
11. Now open the second gnucash account (e.g. Account2)
12. Call online action "Requests transactions..." for this account.
Ensure that the selected date interval covers at least
one transaction.
13. Quit the "Generic import transaction matcher" dialog with "OK".
Please note that the transactions are imported to
the first gnucash account but not to the second one which has
been opened just before. The output from the script now looks like:
obj_guid acc_name slot_name s slot_value
---------- -------- -------------------- - -----------------
aa18bf8... Account2 hbci 9 a4f05a2...
a4f05a2... hbci/account-id 4 XXXXXXXXX
a4f05a2... hbci/account-uid 1 2
a4f05a2... hbci/bank-code 4 50010060
a4f05a2... hbci/trans-retrieval 6 2020-02-16 17:23:20
34a7f42... Account1 hbci 9 4b3499c...
4b3499c... hbci/account-id 4 XXXXXXXXX
4b3499c... hbci/account-uid 1 2
4b3499c... hbci/bank-code 4 50010060
34a7f42... Account1 online_id 4 50010060XXXXXXXXX
The timestamp for the most recent transaction retrieval
'hbci/trans-retrieval' has been assigned to the second gnucash
account although the imported transactions have been saved to the
first gnucash account.
14. Open the first gnucash account again.
15. Call online action "Requests transactions..." for this account.
Please note that the from-date is set to the
"Earliest possible date".
obj_guid acc_name slot_name s slot_value
---------- -------- -------------------- - -----------------
aa18bf8... Account2 hbci 9 a4f05a2...
a4f05a2... hbci/account-id 4 XXXXXXXXX
a4f05a2... hbci/account-uid 1 2
a4f05a2... hbci/bank-code 4 50010060
a4f05a2... hbci/trans-retrieval 6 2020-02-16 17:23:20
34a7f42... Account1 hbci 9 044436e...
044436e... hbci/account-id 4 XXXXXXXXX
044436e... hbci/account-uid 1 2
044436e... hbci/bank-code 4 50010060
044436e... hbci/trans-retrieval 6 2020-02-16 17:34:27
34a7f42... Account1 online_id 4 50010060XXXXXXXXX
At this stage I don't see a way to get rid of these weird assignments:
If I delete the "Online ID" within the "Import Map Editor" (there is
only one entry for the first gnucash account) only the 'online_id' slot
attribute is removed from the first gnucash account. The output of the
script will now look like:
obj_guid acc_name slot_name s slot_value
---------- -------- -------------------- - -----------------
aa18bf8... Account2 hbci 9 a4f05a2...
a4f05a2... hbci/account-id 4 XXXXXXXXX
a4f05a2... hbci/account-uid 1 2
a4f05a2... hbci/bank-code 4 50010060
a4f05a2... hbci/trans-retrieval 6 2020-02-16 17:23:20
34a7f42... Account1 hbci 9 fa9353e...
fa9353e... hbci/account-id 4 XXXXXXXXX
fa9353e... hbci/account-uid 1 2
fa9353e... hbci/bank-code 4 50010060
fa9353e... hbci/trans-retrieval 6 2020-02-16 17:34:27
Even if I delete the entire aqbanking user with the help of the
"AqBanking Wizard" these 'hbci...' slot entries will remain.
How can I get rid of them?
For the problem with the lost assigments at step 8 I have already found
a solution which I have appended as a patch to bugzilla
https://bugs.gnucash.org/show_bug.cgi?id=797540 some days ago.
For the other mapping issues I have no clear idea how it should work
correctly. Due to the fact that I have only bank connections based on
hbci/fints I can't judge what the requirements for other
protocols/formats (e.g. Paypal, OFX, EBICS, ...) are.
Should it be allowed to assign the same aqbanking account to more than
one gnucash account?
I would expect that 'hbci/account-uid' is already sufficient for the
mapping with aqbanking version 6. But what should happen if two
different (logon) users use the same gnucash file and bank account has
different unique ids within their private aqbanking settings?
What is the exact role of the 'online_id'?
Maybe somebody else from the list can give me more insight into this topic.
Kind regards and thanks for your help,
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: view_hbci_slots.sh
Type: application/x-shellscript
Size: 562 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-user/attachments/20200216/192ed827/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gnucash.org/pipermail/gnucash-user/attachments/20200216/192ed827/attachment.sig>
More information about the gnucash-user
mailing list