Skip to content

Commit

Permalink
Including the transaction text into the purpose text
Browse files Browse the repository at this point in the history
Some banks include additional purpose information for a transaction in
non-swift-section 17 (aka transaction text). If available, this
transaction text is put in front of the other purpose texts to provide
full transaction information.

While the final solution is still under discussion. This change is a
first low-impact implementation backported and distilled from the work
discussed in #139.
  • Loading branch information
Ueli Niederer authored and jralls committed Mar 30, 2017
1 parent 509ce16 commit 0ad94dd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/import-export/aqb/gnc-ab-utils.c
Expand Up @@ -364,10 +364,18 @@ gchar *
gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans)
{
const GWEN_STRINGLIST *ab_purpose;
const char *ab_transactionText = NULL;
gchar *gnc_description = NULL;

g_return_val_if_fail(ab_trans, g_strdup(""));

/* According to AqBanking, some of the non-swift lines have a special
* meaning. Some banks place valuable text into the transaction text,
* hence we put this text in front of the purpose. */
ab_transactionText = AB_Transaction_GetTransactionText(ab_trans);
if (ab_transactionText)
gnc_description = g_strdup(ab_transactionText);

ab_purpose = AB_Transaction_GetPurpose(ab_trans);
if (ab_purpose)
GWEN_StringList_ForEach(ab_purpose, join_ab_strings_cb,
Expand Down

0 comments on commit 0ad94dd

Please sign in to comment.