Christian Stimming's report patch.

* src/scm/report/average-balance.scm, category-barchart.scm,
	income-expense-graph.scm, net-worth-timeseries.scm, portfolio.scm:
	Added menu-path for reports.

	* src/scm/report/account-piecharts.scm: Report title is now
	fetched from Reportname option. Slices and legend now have
	different URLs.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3946 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-04-12 05:07:37 +00:00
parent 6239ae0777
commit 818eaefc66
7 changed files with 78 additions and 43 deletions

View File

@ -1,3 +1,13 @@
2001-04-11 Christian Stimming <stimming@tuhh.de>
* src/scm/report/average-balance.scm, category-barchart.scm,
income-expense-graph.scm, net-worth-timeseries.scm, portfolio.scm:
Added menu-path for reports.
* src/scm/report/account-piecharts.scm: Report title is now
fetched from Reportname option. Slices and legend now have
different URLs.
2001-04-11 Dave Peticolas <dave@krondo.com>
* src/gnome/dialog-commodities.c: more work

View File

@ -44,6 +44,9 @@
(optname-to-date (N_ "To"))
(optname-report-currency (N_ "Report's currency"))
;; defined in report.scm
(optname-reportname "Report name")
(pagename-accounts (N_ "Accounts"))
(optname-accounts (N_ "Accounts"))
(optname-levels (N_ "Show Accounts until level"))
@ -147,6 +150,7 @@
(account-levels (op-value pagename-accounts optname-levels))
(report-currency (op-value pagename-general
optname-report-currency))
(report-title (op-value pagename-general optname-reportname))
(show-fullname? (op-value pagename-display optname-fullname))
(show-total? (op-value pagename-display optname-show-total))
@ -269,35 +273,45 @@
(gnc:report-anchor-text
(gnc:make-report reportname options))))))
;; set the URLs
(let ((urls
(map
;; set the URLs; the slices are links to other reports
(gnc:html-piechart-set-button-1-slice-urls!
chart
(map
(lambda (pair)
(if (string? (cadr pair))
other-anchor
(let* ((acct (cadr pair))
(subaccts
(gnc:account-get-immediate-subaccounts acct)))
(if (null? subaccts)
;; if leaf-account, make this an anchor
;; to the register.
(gnc:account-anchor-text (cadr pair))
;; if non-leaf account, make this a link
;; to another report which is run on the
;; immediate subaccounts of this account
;; (and including this account).
(gnc:make-report-anchor
reportname
(gnc:report-options report-obj)
(list
(list pagename-accounts optname-accounts
(cons acct subaccts))
(list pagename-accounts optname-levels
(+ 1 tree-depth))
(list pagename-general optname-reportname
((if show-fullname?
gnc:account-get-full-name
gnc:account-get-name) acct))))))))
combined))
(gnc:html-piechart-set-button-1-legend-urls!
chart (map
(lambda (pair)
(if (string? (cadr pair))
other-anchor
(let* ((acct (cadr pair))
(subaccts
(gnc:account-get-immediate-subaccounts
acct)))
(if (null? subaccts)
;; if leaf-account, make this an anchor
;; to the register.
(gnc:account-anchor-text (cadr pair))
;; if non-leaf account, make this a link
;; to another report which is run on the
;; immediate subaccounts of this account
;; (and including this account).
(gnc:make-report-anchor
reportname
(gnc:report-options report-obj)
(list
(list pagename-accounts optname-accounts
(cons acct subaccts))
(list pagename-accounts optname-levels
(+ 1 tree-depth))))))))
combined)))
(gnc:html-piechart-set-button-1-slice-urls! chart urls)
(gnc:html-piechart-set-button-1-legend-urls! chart urls))
(gnc:account-anchor-text (cadr pair))))
combined))
(gnc:html-piechart-set-title!
chart report-title)
@ -324,21 +338,22 @@
"")))
(gnc:html-piechart-set-labels!
chart
(map (lambda (pair)
(string-append
(if (string? (cadr pair))
(cadr pair)
((if show-fullname?
gnc:account-get-full-name
gnc:account-get-name) (cadr pair)))
(if show-total?
(string-append
" - "
(gnc:amount->string (car pair) print-info))
"")))
combined))
(let ((urls
(map
(lambda (pair)
(string-append
(if (string? (cadr pair))
(cadr pair)
((if show-fullname?
gnc:account-get-full-name
gnc:account-get-name) (cadr pair)))
(if show-total?
(string-append
" - "
(gnc:amount->string (car pair) print-info))
"")))
combined)))
(gnc:html-piechart-set-labels! chart urls))
(gnc:html-document-add-object! document chart)
@ -349,6 +364,9 @@
(gnc:define-report
'version 1
'name (car l)
'menu-path (if (cadddr l)
(list "_Income & Expense")
(list "_Assets & Liabilities"))
'options-generator (lambda () (options-generator (cadr l)
(cadddr l)))
'renderer (lambda (report-obj)

View File

@ -417,5 +417,6 @@
(gnc:define-report
'version 1
'name (N_ "Average Balance")
'menu-path (list "_Assets & Liabilities")
'options-generator options-generator
'renderer renderer))

View File

@ -378,8 +378,10 @@
(lambda (l)
(gnc:define-report
'version 1
;; why I use a variable here? See comment at the top.
'name (car l)
'menu-path (if (cadddr l)
(list "_Income & Expense")
(list "_Assets & Liabilities"))
'options-generator (lambda () (options-generator (cadr l)))
'renderer (lambda (report-obj)
(category-barchart-renderer report-obj

View File

@ -212,6 +212,7 @@
;; untranslated value here!
'name (N_ "Income/Expense Chart")
'menu-path (list "_Income & Expense")
;; The options generator function defined above.
'options-generator options-generator

View File

@ -229,6 +229,8 @@
;; untranslated value here!
'name (N_ "Net Worth Barchart")
'menu-path (list "_Assets & Liabilities")
;; The options generator function defined above.
'options-generator options-generator

View File

@ -163,6 +163,7 @@
;; untranslated value here!
'name (N_ "Investment Portfolio")
'menu-path (list "_Assets & Liabilities")
;; The options generator function defined above.
'options-generator options-generator