Fix up some more reports to use cell tags which allow CSS style manipulation

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18217 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Phil Longstaff 2009-07-18 18:40:00 +00:00
parent 9afa0a2807
commit 787d8f6a39
6 changed files with 74 additions and 64 deletions

View File

@ -682,8 +682,8 @@
(total-basis 'add currency (sum-basis basis-list))
;; build a list for the row based on user selections
(if show-symbol (append! activecols (list ticker-symbol)))
(if show-listing (append! activecols (list listing)))
(if show-symbol (append! activecols (list (gnc:make-html-table-header-cell/markup "text-cell" ticker-symbol))))
(if show-listing (append! activecols (list (gnc:make-html-table-header-cell/markup "text-cell" listing))))
(if show-shares (append! activecols (list (gnc:make-html-table-header-cell/markup
"number-cell" (xaccPrintAmount units share-print-info)))))
(if show-price (append! activecols (list (gnc:make-html-table-header-cell/markup

View File

@ -444,7 +444,7 @@
table
"grand-total"
(list
(_ "Money In")
(gnc:make-html-table-header-cell/markup "text-cell" (_ "Money In"))
(gnc:make-html-table-header-cell/markup
"total-number-cell" (gnc:sum-collector-commodity money-in-collector report-currency exchange-fn))))
@ -489,7 +489,7 @@
table
"grand-total"
(list
(_ "Money Out")
(gnc:make-html-table-header-cell/markup "text-cell" (_ "Money Out"))
(gnc:make-html-table-header-cell/markup
"total-number-cell" (gnc:sum-collector-commodity money-out-collector report-currency exchange-fn))))
@ -499,7 +499,7 @@
table
"grand-total"
(list
(_ "Difference")
(gnc:make-html-table-header-cell/markup "text-cell" (_ "Difference"))
(gnc:make-html-table-header-cell/markup
"total-number-cell" (gnc:sum-collector-commodity money-diff-collector report-currency exchange-fn))))

View File

@ -146,8 +146,8 @@
table
row-style
(list (gnc:html-account-anchor current)
ticker-symbol
listing
(gnc:make-html-table-header-cell/markup "text-cell" ticker-symbol)
(gnc:make-html-table-header-cell/markup "text-cell" listing)
(gnc:make-html-table-header-cell/markup
"number-cell"
(xaccPrintAmount units share-print-info))

View File

@ -147,55 +147,69 @@
(if (date-col column-vector)
(addto! row-contents
(if transaction-info?
(gnc-print-date
(gnc-transaction-get-date-posted parent))
" ")))
(gnc:make-html-table-cell/markup
"text-cell"
(gnc-print-date
(gnc-transaction-get-date-posted parent)))
" ")))
(if (num-col column-vector)
(addto! row-contents
(if transaction-info?
(xaccTransGetNum parent)
(if split-info?
(xaccSplitGetAction split)
" "))))
(gnc:make-html-table-cell/markup
"text-cell"
(if transaction-info?
(xaccTransGetNum parent)
(if split-info?
(xaccSplitGetAction split)
" ")))))
(if (description-col column-vector)
(addto! row-contents
(if transaction-info?
(if description?
(xaccTransGetDescription parent)
" " )
(if split-info?
(if memo?
(xaccSplitGetMemo split)
" ")
" "))))
(gnc:make-html-table-cell/markup
"text-cell"
(if transaction-info?
(if description?
(xaccTransGetDescription parent)
" " )
(if split-info?
(if memo?
(xaccSplitGetMemo split)
" ")
" ")))))
(if (memo-col column-vector)
(addto! row-contents
(if transaction-info?
(xaccSplitGetMemo split)
" ")))
(gnc:make-html-table-cell/markup
"text-cell"
(if transaction-info?
(xaccSplitGetMemo split)
" "))))
(if (account-col column-vector)
(addto! row-contents
(if split-info?
(if transaction-info?
(let ((other-split
(xaccSplitGetOtherSplit split)))
(if (not (null? other-split))
(gnc-account-get-full-name
(xaccSplitGetAccount other-split))
(_ "-- Split Transaction --")))
(gnc-account-get-full-name account))
" ")))
(gnc:make-html-table-cell/markup
"text-cell"
(if split-info?
(if transaction-info?
(let ((other-split
(xaccSplitGetOtherSplit split)))
(if (not (null? other-split))
(gnc-account-get-full-name
(xaccSplitGetAccount other-split))
(_ "-- Split Transaction --")))
(gnc-account-get-full-name account))
" "))))
(if (shares-col column-vector)
(addto! row-contents
(if split-info?
(xaccSplitGetAmount split)
" ")))
(gnc:make-html-table-cell/markup
"text-cell"
(if split-info?
(xaccSplitGetAmount split)
" "))))
(if (price-col column-vector)
(addto! row-contents
(if split-info?
(gnc:make-gnc-monetary
currency (xaccSplitGetSharePrice split))
" ")))
(gnc:make-html-table-cell/markup
"text-cell"
(if split-info?
(gnc:make-gnc-monetary
currency (xaccSplitGetSharePrice split))
" "))))
(if (amount-single-col column-vector)
(addto! row-contents
(if split-info?

View File

@ -216,12 +216,12 @@
table
subtotal-style
(if export?
(append! (cons (gnc:make-html-table-cell subtotal-string)
(append! (cons (gnc:make-html-table-cell/markup "total-label-cell" subtotal-string)
(gnc:html-make-empty-cells (- width 2)))
(list (gnc:make-html-table-cell/markup
"total-number-cell"
(car currency-totals))))
(list (gnc:make-html-table-cell/size 1 (- width 1)
(list (gnc:make-html-table-cell/size/markup 1 (- width 1) "total-label-cell"
subtotal-string)
(gnc:make-html-table-cell/markup
"total-number-cell"
@ -473,23 +473,27 @@
(if (used-date column-vector)
(addto! row-contents
(if transaction-row?
(gnc-print-date (gnc-transaction-get-date-posted parent))
(gnc:make-html-table-cell/markup "text-cell"
(gnc-print-date (gnc-transaction-get-date-posted parent)))
" ")))
(if (used-reconciled-date column-vector)
(addto! row-contents
(let ((date (gnc-split-get-date-reconciled split)))
(if (equal? date (cons 0 0))
" "
(gnc-print-date date)))))
(gnc:make-html-table-cell/markup "text-cell"
(let ((date (gnc-split-get-date-reconciled split)))
(if (equal? date (cons 0 0))
" "
(gnc-print-date date))))))
(if (used-num column-vector)
(addto! row-contents
(if transaction-row?
(xaccTransGetNum parent)
(gnc:make-html-table-cell/markup "text-cell"
(xaccTransGetNum parent))
" ")))
(if (used-description column-vector)
(addto! row-contents
(if transaction-row?
(xaccTransGetDescription parent)
(gnc:make-html-table-cell/markup "text-cell"
(xaccTransGetDescription parent))
" ")))
(if (used-memo column-vector)

View File

@ -44,13 +44,9 @@
(len (string-length font-name))
(idx 0)
)
(gnc:debug "'" font-name "'")
(set! idx (string-index-right font-name #\space))
(gnc:debug idx)
(set! font-size (substring font-name (+ idx 1) len))
(gnc:debug "font-size '" font-size "'")
(set! font-name (string-take font-name idx))
(gnc:debug "font-name: '" font-name "'")
(set! font-weight-idx (string-contains-ci font-name " bold"))
(if font-weight-idx
(begin
@ -58,8 +54,6 @@
(set! font-name (string-append (string-take font-name font-weight-idx)
(string-drop font-name (+ font-weight-idx 5))))
))
(gnc:debug "font-name: '" font-name "'")
(gnc:debug "font-weight: " font-weight)
(set! font-style-idx (string-contains-ci font-name " italic"))
(if font-style-idx
(begin
@ -67,15 +61,12 @@
(set! font-name (string-append (string-take font-name font-style-idx)
(string-drop font-name (+ font-style-idx 7))))
))
(gnc:debug "font-name: '" font-name "'")
(gnc:debug "font-style: " font-style)
(set! font-family font-name)
(set! result (string-append
"font-family: " font-family "; "
"font-size: " font-size "pt; "
(if font-style (string-append "font-style: " font-style "; ") "")
(if font-weight (string-append "font-weight: " font-weight "; ") "")))
(gnc:debug result)
result
))
@ -266,8 +257,9 @@
(string-append
"h3 { " title-font-info " }\n"
"a { " account-link-font-info " }\n"
"td.number-cell { text-align:right; " number-cell-font-info " }\n"
"td.number-header { text-align:right; " number-header-font-info " }\n"
"th { text-align: right; " number-header-font-info " }\n"
"td.number-cell { text-align: right; " number-cell-font-info " }\n"
"td.number-header { text-align: right; " number-header-font-info " }\n"
"td.text-cell { text-align: left; " text-cell-font-info " }\n"
"td.total-number-cell { text-align:right; " total-number-cell-font-info " }\n"
"td.total-label-cell { text-align: left; " total-label-cell-font-info " }\n"