r20144 - gnucash/trunk - Bug #640233: Don't add "Account unknown Bank Unknown" memo when account and/or bank does not exist
Christian Stimming
cstim at code.gnucash.org
Sat Jan 22 09:36:19 EST 2011
Author: cstim
Date: 2011-01-22 09:36:18 -0500 (Sat, 22 Jan 2011)
New Revision: 20144
Trac: http://svn.gnucash.org/trac/changeset/20144
Modified:
gnucash/trunk/AUTHORS
gnucash/trunk/src/import-export/aqbanking/gnc-ab-utils.c
Log:
Bug #640233: Don't add "Account unknown Bank Unknown" memo when account and/or bank does not exist
Patch by Jeff Kletsky:
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.
More information about the gnucash-patches
mailing list