gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Tue Jan 19 04:16:47 EST 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/960917e8 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/dc4a004b (commit)
	from  https://github.com/Gnucash/gnucash/commit/16c9eb5d (commit)



commit 960917e88f523208580f92239d6a18daa230b0c6
Merge: 16c9eb5de dc4a004b1
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Jan 19 17:16:06 2021 +0800

    Merge branch 'maint-798085' into maint #878


commit dc4a004b113b7fba1fa77ca1919a40a58c2941a7
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Fri Jan 15 21:58:13 2021 +0800

    Bug 798085 - Incorrect transactions import of deposit with large number amount
    
    Quicken 2005 introduces U amount which sometimes differs from T
    amount. U amount has larger range, and must override T amount whenever
    they're not equal.

diff --git a/gnucash/import-export/qif-imp/qif-file.scm b/gnucash/import-export/qif-imp/qif-file.scm
index db3e29092..1429b5483 100644
--- a/gnucash/import-export/qif-imp/qif-file.scm
+++ b/gnucash/import-export/qif-imp/qif-file.scm
@@ -135,6 +135,12 @@
 	      (unread-char c1)
 	      #f))))
 
+      (define (qif-split-set-amount split value override?)
+        (when (and split
+                   (not-bad-numeric-string? value)
+                   (or override? (not (qif-split:amount split))))
+          (qif-split:set-amount! split value)))
+
       (qif-file:set-path! self path)
       (if (not (access? path R_OK))
           ;; A UTF-8 encoded path won't succeed on some systems, such as
@@ -261,9 +267,13 @@
 
                            ;; T : total amount
                            ((#\T)
-                            (if (and default-split
-                                    (not-bad-numeric-string? value))
-                                (qif-split:set-amount! default-split value)))
+                            (qif-split-set-amount default-split value #f))
+
+                           ;; U : total amount (handle larger amount
+                           ;; than T; present in Quicken 2005
+                           ;; exports). See bug 798085
+                           ((#\U)
+                            (qif-split-set-amount default-split value #t))
 
                            ;; P : payee
                            ((#\P)



Summary of changes:
 gnucash/import-export/qif-imp/qif-file.scm | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list