r16918 - gnucash/branches/2.2/src/import-export/qif-import - [r16907] Bug#510962: warn the user when encountering a QIF import file without date lines. Patch from Charles Day <cedayiv gmail com>.

Andreas Köhler andi5 at cvs.gnucash.org
Sat Feb 2 21:17:06 EST 2008


Author: andi5
Date: 2008-02-02 21:17:06 -0500 (Sat, 02 Feb 2008)
New Revision: 16918
Trac: http://svn.gnucash.org/trac/changeset/16918

Modified:
   gnucash/branches/2.2/src/import-export/qif-import/qif-file.scm
Log:
[r16907] Bug#510962: warn the user when encountering a QIF import file without date lines.  Patch from Charles Day <cedayiv gmail com>.


Modified: gnucash/branches/2.2/src/import-export/qif-import/qif-file.scm
===================================================================
--- gnucash/branches/2.2/src/import-export/qif-import/qif-file.scm	2008-02-03 02:16:57 UTC (rev 16917)
+++ gnucash/branches/2.2/src/import-export/qif-import/qif-file.scm	2008-02-03 02:17:06 UTC (rev 16918)
@@ -40,6 +40,7 @@
           (tag #f)
           (value #f)
           (heinous-error #f)
+          (missing-date-warned #f)
           (delimiters (string #\cr #\nl))
           (progress-dialog '())
           (file-stats (stat path))
@@ -238,7 +239,17 @@
                                                 current-account-name) 
                         
                         (if (qif-xtn:date current-xtn)
-                            (qif-file:add-xtn! self current-xtn))
+                            (qif-file:add-xtn! self current-xtn)
+                            ;; The date is missing! Warn the user if they
+                            ;; haven't been warned already.
+                            (if (not missing-date-warned)
+                                (begin
+                                  (set! missing-date-warned #t)
+                                  (gnc-warning-dialog '() (string-append
+                              (_ "One or more transactions is missing a date.")
+                              "\n"
+                              (_ "Some transactions may be discarded."))))))
+
                         ;;(write current-xtn) (newline)
                         (set! current-xtn (make-qif-xtn))
                         (set! current-split #f)



More information about the gnucash-changes mailing list