gnucash stable: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Sat Jan 20 23:50:47 EST 2024
Updated via https://github.com/Gnucash/gnucash/commit/e8bb8b61 (commit)
via https://github.com/Gnucash/gnucash/commit/f7e3038e (commit)
from https://github.com/Gnucash/gnucash/commit/6d0007ec (commit)
commit e8bb8b614698a675b924fc05e689d8630f2af3df
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sun Jan 21 12:31:30 2024 +0800
Bug 799224 - Import of QIF gets Bug detected during duplicates (partial fix)
If the new-splits object is null, it means the new account tree from
the current import has no splits. Therefore the (apply min|max dates)
will fail. Omitting the date query is a simple fix to prevent crashing.
This is a partial fix because the crash is likely a symptom of another
bug which causes the new account-tree to be empty.
diff --git a/gnucash/import-export/qif-imp/qif-merge-groups.scm b/gnucash/import-export/qif-imp/qif-merge-groups.scm
index 262e224d6b..868a642314 100644
--- a/gnucash/import-export/qif-imp/qif-merge-groups.scm
+++ b/gnucash/import-export/qif-imp/qif-merge-groups.scm
@@ -85,10 +85,14 @@
(dates (map (compose xaccTransGetDate xaccSplitGetParent) new-splits)))
(qof-query-set-book q (gnc-account-get-book old-root))
(xaccQueryAddAccountMatch q old-accounts QOF-GUID-MATCH-ANY QOF-QUERY-AND)
- (xaccQueryAddDateMatchTT q
- #t (decdate (apply min dates) WeekDelta)
- #t (incdate (apply max dates) WeekDelta)
- QOF-QUERY-AND)
+ (cond
+ ((null? dates)
+ (gnc:warn "Probable error: the new account tree has no transactions."))
+ (else
+ (xaccQueryAddDateMatchTT q
+ #t (decdate (apply min dates) WeekDelta)
+ #t (incdate (apply max dates) WeekDelta)
+ QOF-QUERY-AND)))
(let ((splits (qof-query-run q)))
(qof-query-destroy q)
splits)))
commit f7e3038e38ea963525a6beff3782d8cdaca2bdcc
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sun Jan 21 12:41:32 2024 +0800
Bug 799225 - QIF Importer Crashes Silently after "Start Import" Button
Don't allow a QIF investment transaction without an action (buy/sell/etc)
diff --git a/gnucash/import-export/qif-imp/qif-to-gnc.scm b/gnucash/import-export/qif-imp/qif-to-gnc.scm
index dda5214d2a..c67defab36 100644
--- a/gnucash/import-export/qif-imp/qif-to-gnc.scm
+++ b/gnucash/import-export/qif-imp/qif-to-gnc.scm
@@ -596,6 +596,13 @@
(else
(apply xaccTransSetDate gnc-xtn (qif-xtn:date qif-xtn))))
+ (unless qif-action
+ (qif-import:log progress-dialog "qif-import:qif-xtn-to-gnc-xtn"
+ (format #f (G_ "Missing QIF investment action for transaction dated ~a.")
+ (qof-print-date (qif-date-to-time64 qif-date))))
+ (throw 'missing-action "qif-import:qif-xtn-to-gnc-xtn" "Missing investment action."
+ #f #f))
+
;; fixme: bug #105
(if qif-payee
(xaccTransSetDescription gnc-xtn qif-payee))
Summary of changes:
gnucash/import-export/qif-imp/qif-merge-groups.scm | 12 ++++++++----
gnucash/import-export/qif-imp/qif-to-gnc.scm | 7 +++++++
2 files changed, 15 insertions(+), 4 deletions(-)
More information about the gnucash-changes
mailing list