|
108 | 108 | (gnc:make-gnc-monetary currency numeric))) |
109 | 109 |
|
110 | 110 | (define layout-key-list |
111 | | - (list (cons 'client (list (cons 'text (G_ "Client or vendor name, address and ID")))) |
112 | | - (cons 'company (list (cons 'text (G_ "Company name, address and tax-ID")))) |
113 | | - (cons 'invoice (list (cons 'text (G_ "Invoice date, due date, billing ID, terms, job details")))) |
114 | | - (cons 'today (list (cons 'text (G_ "Today's date")))) |
115 | | - (cons 'picture (list (cons 'text (G_ "Picture")))) |
| 111 | + (list (list 'client |
| 112 | + (cons 'renderer make-client-table) |
| 113 | + (cons 'text (G_ "Client or vendor name, address and ID"))) |
| 114 | + |
| 115 | + (list 'company |
| 116 | + (cons 'renderer make-company-table) |
| 117 | + (cons 'text (G_ "Company name, address and tax-ID"))) |
| 118 | + |
| 119 | + (list 'invoice |
| 120 | + (cons 'renderer make-invoice-details-table) |
| 121 | + (cons 'text (G_ "Invoice date, due date, billing ID, terms, job details"))) |
| 122 | + |
| 123 | + (list 'today |
| 124 | + (cons 'renderer make-today) |
| 125 | + (cons 'text (G_ "Today's date"))) |
| 126 | + |
| 127 | + (list 'picture |
| 128 | + (cons 'renderer make-picture) |
| 129 | + (cons 'text (G_ "Picture"))) |
116 | 130 |
|
117 | 131 | ;; Translators: "Empty space" refers to invoice header section being left blank |
118 | | - (cons 'none (list (cons 'text (G_ "Empty space")))))) |
| 132 | + (list 'none |
| 133 | + (cons 'renderer (const #f)) |
| 134 | + (cons 'text (G_ "Empty space"))))) |
119 | 135 |
|
120 | 136 | (define variant-list |
121 | 137 | (list |
@@ -768,13 +784,10 @@ for styling the invoice. Please see the exported report for the CSS class names. |
768 | 784 | ;; " #" by whatever is common as number abbreviation, |
769 | 785 | ;; i.e. "~a Nr. ~a" |
770 | 786 | (invoice-title (format #f (G_"~a #~a") title (gncInvoiceGetID invoice))) |
771 | | - (layout-lookup-table (list (cons 'none #f) |
772 | | - (cons 'picture (make-picture options)) |
773 | | - (cons 'invoice (make-invoice-details-table options)) |
774 | | - (cons 'client (make-client-table options)) |
775 | | - (cons 'company (make-company-table options)) |
776 | | - (cons 'today (make-today options)))) |
777 | | - (layout-lookup (lambda (loc) (cdr (assq (opt-val "Layout" loc) layout-lookup-table))))) |
| 787 | + (layout-lookup (lambda (loc) |
| 788 | + (let* ((key (opt-val "Layout" loc)) |
| 789 | + (renderer (keylist-get-info layout-key-list key 'renderer))) |
| 790 | + (renderer options))))) |
778 | 791 |
|
779 | 792 | (gnc:html-document-set-style-text! document (opt-val "Layout" "CSS")) |
780 | 793 |
|
|
0 commit comments