r20791 - gnucash/branches/2.4/src/report/business-reports - [20786] Bug #652435 - Fancy invoice export has <generic> tags in it preventing html validation Patch by Bert Claesen BP

Christian Stimming cstim at code.gnucash.org
Tue Jun 21 06:05:14 EDT 2011


Author: cstim
Date: 2011-06-21 06:05:14 -0400 (Tue, 21 Jun 2011)
New Revision: 20791
Trac: http://svn.gnucash.org/trac/changeset/20791

Modified:
   gnucash/branches/2.4/src/report/business-reports/fancy-invoice.scm
Log:
[20786] Bug #652435 - Fancy invoice export has <generic> tags in it preventing html validation Patch by Bert Claesen BP

Original commit by gjanssens.

Modified: gnucash/branches/2.4/src/report/business-reports/fancy-invoice.scm
===================================================================
--- gnucash/branches/2.4/src/report/business-reports/fancy-invoice.scm	2011-06-21 10:05:03 UTC (rev 20790)
+++ gnucash/branches/2.4/src/report/business-reports/fancy-invoice.scm	2011-06-21 10:05:14 UTC (rev 20791)
@@ -418,6 +418,15 @@
 		    (gnc:monetary-neg monetary)
 		    monetary)
 		monetary))))
+    
+    (define (get-empty-row colcount)
+      (define row-contents '())
+      (do ((i 1 (+ i 1)))
+        ((> i colcount))
+        (addto! row-contents (gnc:make-html-table-cell))    ;;do stuff here
+        )
+      row-contents
+      )
 
     (define (add-subtotal-row table used-columns
 			      subtotal-collector subtotal-style subtotal-label)
@@ -499,14 +508,13 @@
 	    ;; oli-custom - modified to have a minimum of entries per table,
 	    ;; currently defaults to 24
 	    ;; also, doesn't count payment rows and stuff
-	    (do ((entries-added entries-added (+ entries-added 1))
-		 (odd-row? odd-row? (not odd-row?)))
-		((> entries-added (opt-val "Display" "Minimum # of entries" )))
-		(gnc:html-table-append-row/markup!
-		 table (if odd-row? "normal-row" "alternate-row")
-		 (string->list (make-string (num-columns-required used-columns)
-					    #\space)))
-		)
+            (do ((entries-added entries-added (+ entries-added 1))
+                 (odd-row? odd-row? (not odd-row?)))
+              ((> entries-added (opt-val "Display" "Minimum # of entries" )))
+              (gnc:html-table-append-row/markup!
+               table (if odd-row? "normal-row" "alternate-row")
+               (get-empty-row (num-columns-required used-columns)))
+              )
 	    (add-subtotal-row table used-columns value-collector
 			      "grand-total" (_ "Net Price"))
 
@@ -648,7 +656,7 @@
     (gnc:html-table-cell-set-style!
      name-cell "td"
      'font-size "+2")
-    (gnc:html-table-append-row! table (list name-cell #\newline "<br>"))
+    (gnc:html-table-append-row! table (list name-cell "" "")) ;;Bert: had a newline and a "<br>"
     (gnc:html-table-append-row!
      table
      (list
@@ -744,7 +752,7 @@
     (gnc:html-table-cell-set-style!
 	name-cell "td"
 	'font-size "+2")
-    (gnc:html-table-append-row! table (list name-cell "" invoice-cell))
+    (gnc:html-table-append-row! table (list name-cell (gnc:make-html-table-cell) invoice-cell)) ;;(gnc:make-html-table-cell) was ""
     (gnc:html-table-set-col-style!
 	table 1 "td"
 	'attribute (list "align" "center")



More information about the gnucash-changes mailing list