Christian Stimming's report patch.

* src/scm/html-table.scm (gnc:html-table-remove-last-row!): Added
	function.

	* src/scm/html-utilities.scm (gnc:html-build-acct-table): Added
	removal of the last empty line above the total sum.

	* src/scm/html-document.scm: changed rendering of #f from one
	whitespace to equally arbitrary three whitespaces. FIXME: This
	should be configurable by a style-sheet.

	* src/scm/report/pnl.scm: deactivated column headers.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3895 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-04-05 21:13:53 +00:00
parent 6eb9c411a8
commit c7b23bb007
5 changed files with 46 additions and 3 deletions

View File

@ -1,3 +1,17 @@
2001-04-05 Christian Stimming <stimming@tuhh.de>
* src/scm/html-table.scm (gnc:html-table-remove-last-row!): Added
function.
* src/scm/html-utilities.scm (gnc:html-build-acct-table): Added
removal of the last empty line above the total sum.
* src/scm/html-document.scm: changed rendering of #f from one
whitespace to equally arbitrary three whitespaces. FIXME: This
should be configurable by a style-sheet.
* src/scm/report/pnl.scm: deactivated column headers.
2001-04-05 Robert Graham Merkel <rgmerk@mira.net> 2001-04-05 Robert Graham Merkel <rgmerk@mira.net>
* src/scm/report/balance-sheet.scm: Relabel summary rows, fix * src/scm/report/balance-sheet.scm: Relabel summary rows, fix

View File

@ -362,7 +362,7 @@
(lambda (obj doc) (lambda (obj doc)
(gnc:html-document-render-data doc obj)) (gnc:html-document-render-data doc obj))
;; if the object is #f, make it a placeholder ;; if the object is #f, make it a placeholder
(if obj obj "&nbsp;"))) (if obj obj "&nbsp;&nbsp;&nbsp;")))
(cond (cond
((gnc:html-text? obj) ((gnc:html-text? obj)
(set! o (gnc:make-html-object-internal (set! o (gnc:make-html-object-internal

View File

@ -338,6 +338,20 @@
(gnc:html-table-set-data! table dd) (gnc:html-table-set-data! table dd)
new-num-rows)) new-num-rows))
(define (gnc:html-table-remove-last-row! table)
(if (> (gnc:html-table-num-rows table) 0)
(begin
(gnc:html-table-set-num-rows-internal!
table
(- (gnc:html-table-num-rows table) 1))
(gnc:html-table-set-data!
table
;; Note that the rows in html-table-data are stored in
;; reverse, i.e. the last appended table row is the first
;; list element.
(cdr (gnc:html-table-data table))))
'()))
(define (gnc:html-table-prepend-row! table newrow) (define (gnc:html-table-prepend-row! table newrow)
(let* ((dd (gnc:html-table-data table)) (let* ((dd (gnc:html-table-data table))
(current-num-rows (gnc:html-table-num-rows table)) (current-num-rows (gnc:html-table-num-rows table))

View File

@ -370,7 +370,7 @@
(define (add-group! current-depth groupname subaccounts thisbalance) (define (add-group! current-depth groupname subaccounts thisbalance)
(begin (begin
;; first the group name ;; first the group name
(add-subtotal-row! current-depth groupname #f #f) (add-subtotal-row! current-depth groupname #f #t)
;; then all the subaccounts ;; then all the subaccounts
(traverse-accounts! subaccounts (+ 1 current-depth)) (traverse-accounts! subaccounts (+ 1 current-depth))
;; and now the "total" row ;; and now the "total" row
@ -428,6 +428,21 @@
equal? accounts topl-accounts))) equal? accounts topl-accounts)))
;; No extra grouping. ;; No extra grouping.
(traverse-accounts! (filter show-acct? topl-accounts) 1)) (traverse-accounts! (filter show-acct? topl-accounts) 1))
;; This is kind of a hack: Remove the last appended row iff it has
;; an empty text field (resulting from the add-group! function
;; above). Depends on the structure of html-table-data, i.e. if
;; those are changed then this might break.
(let ((row-head (car (car (gnc:html-table-data table)))))
(if (gnc:html-table-cell? row-head)
(if (car (gnc:html-table-cell-data row-head))
'()
;; html-table-cell-data field is #f i.e. empty.
(gnc:html-table-remove-last-row! table))
(if row-head
'()
;; html-table-data element is #f in itself.
(gnc:html-table-remove-last-row! table))))
;; Show the total sum. ;; Show the total sum.
(if show-total? (if show-total?

View File

@ -139,7 +139,7 @@
;; do the processing here ;; do the processing here
(table (gnc:html-build-acct-table (table (gnc:html-build-acct-table
from-date-tp to-date-tp from-date-tp to-date-tp
tree-depth show-subaccts? accounts #t tree-depth show-subaccts? accounts #f
#t gnc:accounts-get-comm-total-profit #t gnc:accounts-get-comm-total-profit
(_ "Profit") do-grouping? do-subtotals? (_ "Profit") do-grouping? do-subtotals?
show-fcur? report-currency exchange-fn))) show-fcur? report-currency exchange-fn)))