"Account unknown Bank unknown" patch available

Jeff Kletsky gnucash at allycomm.com
Fri Jan 21 19:40:53 EST 2011


https://bugzilla.gnome.org/show_bug.cgi?id=640233

At least for the online OFX sources I use in the US, downloaded
transactions are populated with memos of

"Account unknown Bank unknown"

Past being annoying, this can cause improper "matches" when comparing
transactions.

The root cause is found in src/import-export/aqbanking/gnc-ab-utils.c
in the function gnc_ab_memo_to_gnc where the code seems to check for
the existence of a remote account number from the aqbanking
transaction

if (ab_other_accountid && *ab_other_accountid)

and appears to intend to return the empty string if one is not present.

However, an earlier line in the code sets ab_other_accountid to
"unknown" so that the test always returns true.

This patch should return:

* "Account <account number> Bank <bank number>" if both are present

* "Account <account number>" if only the account is present

* "Bank <bank number>" if only the bank is present

* "" if neither is present

Additionally, ordering of trimming was changed to handle the
possibility that the leading and/or trailing character(s) were stripped
as invalid UTF-8, resulting in an untrimmed string.



NOTE: This patch should be checked using online sources that *do*
populate the account/bank fields to confirm that it is working as
intended in those situations.

Jeff



More information about the gnucash-devel mailing list