* src/scm/report/net-barchart.scm: convert to guile module.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4742 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Rob Browning 2001-06-18 17:45:50 +00:00
parent 2a7ca35fd9
commit 1514fcd828

View File

@ -24,28 +24,31 @@
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(gnc:support "report/net-barchart.scm")
;; depends must be outside module scope -- and should eventually go away.
(gnc:depend "report-html.scm")
(gnc:depend "date-utilities.scm")
(let ((optname-from-date (N_ "From"))
(optname-to-date (N_ "To"))
(optname-stepsize (N_ "Step Size"))
(optname-report-currency (N_ "Report's currency"))
(optname-price-source (N_ "Price Source"))
(optname-accounts (N_ "Accounts"))
(define-module (gnucash report net-barchart))
(optname-inc-exp (N_ "Show Income/Expense"))
(optname-show-profit (N_ "Show Net Profit"))
(define optname-from-date (N_ "From"))
(define optname-to-date (N_ "To"))
(define optname-stepsize (N_ "Step Size"))
(define optname-report-currency (N_ "Report's currency"))
(define optname-price-source (N_ "Price Source"))
(optname-sep-bars (N_ "Show Asset & Liability bars"))
(optname-net-bars (N_ "Show Net Worth bars"))
(define optname-accounts (N_ "Accounts"))
(optname-plot-width (N_ "Plot Width"))
(optname-plot-height (N_ "Plot Height")))
(define optname-inc-exp (N_ "Show Income/Expense"))
(define optname-show-profit (N_ "Show Net Profit"))
(define (options-generator inc-exp?)
(define optname-sep-bars (N_ "Show Asset & Liability bars"))
(define optname-net-bars (N_ "Show Net Worth bars"))
(define optname-plot-width (N_ "Plot Width"))
(define optname-plot-height (N_ "Plot Height"))
(define (options-generator inc-exp?)
(let* ((options (gnc:new-options))
;; This is just a helper function for making options.
;; See gnucash/src/scm/options.scm for details.
@ -119,13 +122,13 @@
options))
;; This is the rendering function. It accepts a database of options
;; and generates an object of type <html-document>. See the file
;; report-html.txt for documentation; the file report-html.scm
;; includes all the relevant Scheme code. The option database passed
;; to the function is one created by the options-generator function
;; defined above.
(define (net-renderer report-obj inc-exp?)
;; This is the rendering function. It accepts a database of options
;; and generates an object of type <html-document>. See the file
;; report-html.txt for documentation; the file report-html.scm
;; includes all the relevant Scheme code. The option database passed
;; to the function is one created by the options-generator function
;; defined above.
(define (net-renderer report-obj inc-exp?)
;; This is a helper function for looking up option values.
(define (get-option section name)
@ -344,17 +347,17 @@
document))
;; Here we define the actual report
(gnc:define-report
;; Here we define the actual report
(gnc:define-report
'version 1
'name (N_ "Net Worth Barchart")
'menu-path (list gnc:menuname-asset-liability)
'options-generator (lambda () (options-generator #f))
'renderer (lambda (report-obj) (net-renderer report-obj #f)))
(gnc:define-report
(gnc:define-report
'version 1
'name (N_ "Income/Expense Chart")
'menu-path (list gnc:menuname-income-expense)
'options-generator (lambda () (options-generator #t))
'renderer (lambda (report-obj) (net-renderer report-obj #t))))
'renderer (lambda (report-obj) (net-renderer report-obj #t)))