gnucash-on-osx master: Bug 798267 - import from UP bank appearing the next day in the transaction list after import

John Ralls jralls at code.gnucash.org
Thu Sep 16 19:46:18 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash-on-osx/commit/0a36995f (commit)
	from  https://github.com/Gnucash/gnucash-on-osx/commit/a42b404f (commit)



commit 0a36995f380be9ee2978ecb74885500387758a17
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Sep 16 16:46:12 2021 -0700

    Bug 798267 - import from UP bank appearing the next day in the transaction list after import

diff --git a/modulesets/gnucash.modules b/modulesets/gnucash.modules
index b5b156f..72e7e48 100644
--- a/modulesets/gnucash.modules
+++ b/modulesets/gnucash.modules
@@ -36,8 +36,8 @@
   <repository type="tarball" name="postgres"
               href="https://ftp.postgresql.org/pub/source/"/>
 
-  <include href="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/modulesets-stable/gtk-osx.modules"/>
- <!--include href="/Users/john/Development/GTK-OSX/gtk-osx-build/modulesets-stable/gtk-osx.modules"/-->
+  <!--include href="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/modulesets-stable/gtk-osx.modules"/-->
+ <include href="/Users/john/Development/GTK-OSX/gtk-osx-build/modulesets-stable/gtk-osx.modules"/>
 
   <autotools id="libchipcard" autogen-sh="autoreconf" autogenargs="--enable-local-install">
     <branch module="229/libchipcard-5.1.5rc2.tar.gz" version="5.1.5rc2"
@@ -133,7 +133,9 @@
 
   <autotools id="libofx" autogen-sh='configure'>
     <branch repo="sourceforge" module="libofx/libofx-0.10.2.tar.gz"
-	    version="0.10.2"/>
+            version="0.10.2">
+      <patch file="libofx-subtract-gmt-offset.patch" strip="1"/>
+    </branch>
     <dependencies>
       <dep package="OpenSP"/>
     </dependencies>
diff --git a/patches/libofx-subtract-gmt-offset.patch b/patches/libofx-subtract-gmt-offset.patch
new file mode 100644
index 0000000..d6e8932
--- /dev/null
+++ b/patches/libofx-subtract-gmt-offset.patch
@@ -0,0 +1,31 @@
+From 86036241d35df6570a19f932f5486d4a27dc3f02 Mon Sep 17 00:00:00 2001
+From: John Ralls <jralls at ceridwen.us>
+Date: Thu, 16 Sep 2021 16:32:30 -0700
+Subject: [PATCH] Reverse the application of gmt offset seconds to struct
+ tm::tm_sec.
+
+A positive gmt offset means that UTC is that many seconds before the
+time indicated in struct tm so the gmt offset should be subtracted
+from tm_sec not added.
+
+Fixes https://bugs.gnucash.org/show_bug.cgi?id=798267.
+---
+ lib/ofx_utilities.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/ofx_utilities.cpp b/lib/ofx_utilities.cpp
+index ced5cf9..6c8aa1e 100644
+--- a/lib/ofx_utilities.cpp
++++ b/lib/ofx_utilities.cpp
+@@ -152,7 +152,7 @@ string AppendCharStringtostring(const SGMLApplication::CharString source, string
+     float ofx_gmt_offset = atof(offset_str.c_str());
+     std::time_t temptime = std::time(nullptr);
+     static const double secs_per_hour = 3600.0;
+-    time.tm_sec += static_cast<int>(ofx_gmt_offset * secs_per_hour);
++    time.tm_sec -= static_cast<int>(ofx_gmt_offset * secs_per_hour);
+     return timegm(&time);
+   }
+ 
+-- 
+2.30.1 (Apple Git-130)
+



Summary of changes:
 modulesets/gnucash.modules               |  8 +++++---
 patches/libofx-subtract-gmt-offset.patch | 31 +++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 3 deletions(-)
 create mode 100644 patches/libofx-subtract-gmt-offset.patch



More information about the gnucash-changes mailing list