AUDIT: r21518 - gnucash/trunk/src/report/standard-reports - Bug #639082 - General Journal report reports an error

Geert Janssens gjanssens at code.gnucash.org
Fri Nov 4 09:43:54 EDT 2011


Author: gjanssens
Date: 2011-11-04 09:43:53 -0400 (Fri, 04 Nov 2011)
New Revision: 21518
Trac: http://svn.gnucash.org/trac/changeset/21518

Modified:
   gnucash/trunk/src/report/standard-reports/register.scm
Log:
Bug #639082 - General Journal report reports an error
BP

Modified: gnucash/trunk/src/report/standard-reports/register.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/register.scm	2011-11-03 21:48:00 UTC (rev 21517)
+++ gnucash/trunk/src/report/standard-reports/register.scm	2011-11-04 13:43:53 UTC (rev 21518)
@@ -562,7 +562,13 @@
                (rest (cdr splits))
                (next (if (null? rest) #f
                          (car rest)))
-               (split-value (add-split-row table 
+               ;; The general ledger has a split that doesn't have an account
+               ;; set yet (the new entry transaction).
+               ;; This split should be skipped or the report errors out.
+               ;; See bug #639082
+               (valid-split? (not (null? (xaccSplitGetAccount current))))
+               (split-value (if valid-split?
+                            (add-split-row table 
                                            current 
                                            used-columns 
                                            current-row-style
@@ -570,13 +576,13 @@
                                            (not multi-rows?)
                                            double?
                                            (opt-val "Display" "Memo")
-                                           (opt-val "Display" "Description"))))
+                                           (opt-val "Display" "Description")))))
 
-          (if multi-rows?
+          (if (and multi-rows? valid-split?)
               (add-other-split-rows 
                current table used-columns "alternate-row"))
 
-          (if multi-rows?
+          (if (and multi-rows? valid-split?)
               (for-each (lambda (split)
                           (if (string=? (gncAccountGetGUID
                                          (xaccSplitGetAccount current))



More information about the gnucash-changes mailing list