GNOME Bugzilla – Bug 640233
Don't add "Account unknown Bank Unknown" memo when account and/or bank does not exist
Last modified: 2018-06-29 22:52:36 UTC
Created attachment 179013 [details] [review] Patch against release-2.4.0 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.
Comment on attachment 179013 [details] [review] Patch against release-2.4.0 Missing gfree
Comment on attachment 179013 [details] [review] Patch against release-2.4.0 Ok, looks good. This can go into trunk as-is.
Comment on attachment 179013 [details] [review] Patch against release-2.4.0 r20144, thanks a lot! (by the way, if you're using git locally anyway, feel free to create the patch by "git format-patch" including the full commit message, which can be copied into the bug description or vice versa.)
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=640233. Please update any external references or bookmarks.