gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Thu Mar 30 15:44:07 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/f9d23de8 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/768df3b7 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/448d9755 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0ad94ddc (commit)
	from  https://github.com/Gnucash/gnucash/commit/509ce16a (commit)



commit f9d23de8c061ae8348a74abe3a8b40d29decadd0
Merge: 509ce16 768df3b
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Mar 30 12:42:59 2017 -0700

    Merge Ueli Neiderer's swift-transactiontxt branch into maint.


commit 768df3b70974a9f55ea21aad05ebcb4a8b647e86
Author: Ueli Niederer <github.com at junix.ch>
Date:   Thu Mar 30 20:53:45 2017 +0200

    Obey GNUcash coding style
    
    Corrected brace position.

diff --git a/src/import-export/aqb/gnc-ab-utils.c b/src/import-export/aqb/gnc-ab-utils.c
index b3db650..3419ec4 100644
--- a/src/import-export/aqb/gnc-ab-utils.c
+++ b/src/import-export/aqb/gnc-ab-utils.c
@@ -319,7 +319,7 @@ join_ab_strings_cb(const gchar *str, gpointer user_data)
 
     if (!str || !*str)
         return NULL;
-
+ 
     tmp = g_strdup(str);
     g_strstrip(tmp);
     gnc_utf8_strip_invalid(tmp);
@@ -369,7 +369,8 @@ gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans)
 
     g_return_val_if_fail(ab_trans, g_strdup(""));
 
-    if (gnc_prefs_get_bool(GNC_PREFS_GROUP_AQBANKING, GNC_PREF_USE_TRANSACTION_TXT)) {
+    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. */

commit 448d97553ff1765b8ac753220af19374fe95f09f
Author: Ueli Niederer <gnucash at junix.ch>
Date:   Thu Mar 30 20:17:44 2017 +0200

    Added a preference to control import behaivour of transaction text
    
    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.

diff --git a/src/import-export/aqb/dialog-ab.glade b/src/import-export/aqb/dialog-ab.glade
index 543e06d..b5c4ee3 100644
--- a/src/import-export/aqb/dialog-ab.glade
+++ b/src/import-export/aqb/dialog-ab.glade
@@ -853,6 +853,25 @@
           </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>
             <property name="visible">True</property>
@@ -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>
diff --git a/src/import-export/aqb/gnc-ab-utils.c b/src/import-export/aqb/gnc-ab-utils.c
index 0c80948..b3db650 100644
--- a/src/import-export/aqb/gnc-ab-utils.c
+++ b/src/import-export/aqb/gnc-ab-utils.c
@@ -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)
diff --git a/src/import-export/aqb/gnc-ab-utils.h b/src/import-export/aqb/gnc-ab-utils.h
index 12d112a..641f299 100644
--- a/src/import-export/aqb/gnc-ab-utils.h
+++ b/src/import-export/aqb/gnc-ab-utils.h
@@ -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;
 
diff --git a/src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in b/src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in
index f12289c..4eccf0f 100644
--- a/src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in
+++ b/src/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in.in
@@ -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>

commit 0ad94ddcc01ea11282b0875d4edb1f77c6db5644
Author: Ueli Niederer <gnucash at junix.ch>
Date:   Tue Mar 28 22:16:30 2017 +0200

    Including the transaction text into the purpose text
    
    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 gnucash/gnucash#139.

diff --git a/src/import-export/aqb/gnc-ab-utils.c b/src/import-export/aqb/gnc-ab-utils.c
index b0b2ffb..0c80948 100644
--- a/src/import-export/aqb/gnc-ab-utils.c
+++ b/src/import-export/aqb/gnc-ab-utils.c
@@ -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,



Summary of changes:
 src/import-export/aqb/dialog-ab.glade              | 23 ++++++++++++++++++++--
 src/import-export/aqb/gnc-ab-utils.c               | 13 +++++++++++-
 src/import-export/aqb/gnc-ab-utils.h               | 11 ++++++-----
 ...g.gnucash.dialogs.import.hbci.gschema.xml.in.in |  5 +++++
 4 files changed, 44 insertions(+), 8 deletions(-)



More information about the gnucash-changes mailing list