Skip to content

Commit

Permalink
Added a preference to control import behaivour of transaction text
Browse files Browse the repository at this point in the history
In order to allow to revert the newly introduced behaviour of putting
transaction text in front of the extracted purpose, the feature can now
be disabled through the preferences dialog.
  • Loading branch information
Ueli Niederer authored and jralls committed Mar 30, 2017
1 parent 0ad94dd commit 448d975
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 13 deletions.
23 changes: 21 additions & 2 deletions src/import-export/aqb/dialog-ab.glade
Expand Up @@ -852,6 +852,25 @@
<property name="x_padding">12</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="pref/dialogs.import.hbci/use-ns-transaction-text">
<property name="label" translatable="yes">Use Non-SWIFT _transaction text</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
<property name="x_padding">12</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton3">
<property name="label" translatable="yes">_Verbose debug messages</property>
Expand All @@ -864,8 +883,8 @@
</object>
<packing>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
<property name="x_padding">12</property>
Expand Down
14 changes: 8 additions & 6 deletions src/import-export/aqb/gnc-ab-utils.c
Expand Up @@ -369,12 +369,14 @@ gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans)

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);
if (gnc_prefs_get_bool(GNC_PREFS_GROUP_AQBANKING, GNC_PREF_USE_TRANSACTION_TXT)) {
/* 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)
Expand Down
11 changes: 6 additions & 5 deletions src/import-export/aqb/gnc-ab-utils.h
Expand Up @@ -70,11 +70,12 @@ G_BEGIN_DECLS
# define AQBANKING_VERSION_4_EXACTLY
#endif

#define GNC_PREFS_GROUP_AQBANKING "dialogs.import.hbci"
#define GNC_PREF_FORMAT_SWIFT940 "format-swift-mt940"
#define GNC_PREF_FORMAT_SWIFT942 "format-swift-mt942"
#define GNC_PREF_FORMAT_DTAUS "format-dtaus"
#define GNC_PREF_VERBOSE_DEBUG "verbose-debug"
#define GNC_PREFS_GROUP_AQBANKING "dialogs.import.hbci"
#define GNC_PREF_FORMAT_SWIFT940 "format-swift-mt940"
#define GNC_PREF_FORMAT_SWIFT942 "format-swift-mt942"
#define GNC_PREF_FORMAT_DTAUS "format-dtaus"
#define GNC_PREF_USE_TRANSACTION_TXT "use-ns-transaction-text"
#define GNC_PREF_VERBOSE_DEBUG "verbose-debug"

typedef struct _GncABImExContextImport GncABImExContextImport;

Expand Down
Expand Up @@ -20,6 +20,11 @@
<summary>Remember the PIN in memory</summary>
<description>If active, the PIN for HBCI/AqBanking actions will be remembered in memory during a session. Otherwise it will have to be entered again each time during a session when it is needed.</description>
</key>
<key name="use-ns-transaction-text" type="b">
<default>true</default>
<summary>Put the transaction text in front of the purpose of a transaction.</summary>
<description>Some banks place part of transaction description as "transaction text" in the MT940 file. Normally GNUcash ignores this text. However by activating this option, the transaction text is used for the transaction description too.</description>
</key>
<key name="verbose-debug" type="b">
<default>false</default>
<summary>Verbose HBCI debug messages</summary>
Expand Down

0 comments on commit 448d975

Please sign in to comment.