[equity-statement] compact and rename to add-report-line

This commit is contained in:
Christopher Lam 2019-09-30 15:30:20 +08:00
parent fd6b102f8e
commit 99b5d79a44

View File

@ -437,7 +437,7 @@
(period-for (string-append " " (_ "for Period"))))
;; a helper to add a line to our report
(define (report-line
(define (add-report-line
table pos-label neg-label amount col
exchange-fn rule? row-style)
(let* ((neg? (and amount
@ -475,58 +475,47 @@
(gnc:report-percent-done 80)
(report-line
(add-report-line
build-table
(string-append (_ "Capital") ", "
(qof-print-date start-date-printable))
#f start-total-equity
1 start-exchange-fn #f "primary-subheading"
)
(report-line
(string-append (_ "Capital") ", " (qof-print-date start-date-printable))
#f start-total-equity 1 start-exchange-fn #f "primary-subheading")
(add-report-line
build-table
(string-append (_ "Net income") period-for)
(string-append (_ "Net loss") period-for)
net-income
0 end-exchange-fn #f #f
)
(report-line
net-income 0 end-exchange-fn #f #f)
(add-report-line
build-table
(string-append (_ "Investments") period-for)
#f
investments
0 end-exchange-fn #f #f
)
(report-line
(string-append (_ "Investments") period-for) #f
investments 0 end-exchange-fn #f #f)
(add-report-line
build-table
(string-append (_ "Withdrawals") period-for)
#f
withdrawals
0 end-exchange-fn #f #f
)
(or (gnc-commodity-collector-allzero? net-unrealized-gains)
(report-line
#f withdrawals 0 end-exchange-fn #f #f)
(unless (gnc-commodity-collector-allzero? net-unrealized-gains)
(add-report-line
build-table
(_ "Unrealized Gains")
(_ "Unrealized Losses")
net-unrealized-gains
0 end-exchange-fn #f #f
)
)
(report-line
0 end-exchange-fn #f #f))
(add-report-line
build-table
(_ "Increase in capital")
(_ "Decrease in capital")
capital-increase
1 end-exchange-fn use-rules? #f
)
(report-line
1 end-exchange-fn use-rules? #f)
(add-report-line
build-table
(string-append (_ "Capital") ", "
(qof-print-date end-date))
#f
(string-append (_ "Capital") ", " (qof-print-date end-date)) #f
end-total-equity
1 end-exchange-fn #f "primary-subheading"
)
1 end-exchange-fn #f "primary-subheading")
(gnc:html-document-add-object! doc build-table)