invoice, easy-invoice.scm: %discount from html-table to string

Old code would nest a small single-row, 2-column html-table within the
entry-list html-table to display discount percentage and '%'. This is
an overkill and causes alignment issues. Display a string instead.
This commit is contained in:
Christopher Lam 2018-03-29 20:16:01 +08:00
parent 7cfb48fea3
commit 5922cbbc4b
2 changed files with 2 additions and 26 deletions

View File

@ -139,19 +139,7 @@
(define (monetary-or-percent numeric currency entry-type)
(if (gnc:entry-type-percent-p entry-type)
(let ((table (gnc:make-html-table)))
(gnc:html-table-set-style!
table "table"
'attribute (list "border" 0)
'attribute (list "cellspacing" 1)
'attribute (list "cellpadding" 0))
(gnc:html-table-append-row!
table
(list numeric (_ "%")))
(set-last-row-style!
table "td"
'attribute (list "valign" "top"))
table)
(string-append (gnc:default-html-gnc-numeric-renderer numeric #f) " " (_ "%"))
(gnc:make-gnc-monetary currency numeric)))
(define (add-entry-row table currency entry column-vector row-style cust-doc? credit-note?)

View File

@ -134,19 +134,7 @@
(define (monetary-or-percent numeric currency entry-type)
(if (gnc:entry-type-percent-p entry-type)
(let ((table (gnc:make-html-table)))
(gnc:html-table-set-style!
table "table"
'attribute (list "border" 0)
'attribute (list "cellspacing" 1)
'attribute (list "cellpadding" 0))
(gnc:html-table-append-row!
table
(list numeric (_ "%")))
(set-last-row-style!
table "td"
'attribute (list "valign" "top"))
table)
(string-append (gnc:default-html-gnc-numeric-renderer numeric #f) " " (_ "%"))
(gnc:make-gnc-monetary currency numeric)))
(define (add-entry-row table currency entry column-vector row-style cust-doc? credit-note?)