reports/example/* untabify/delete-trailing-whitespace

This commit is contained in:
Christopher Lam 2023-04-20 09:00:04 +08:00
parent 8a8960c43a
commit 415438d0d7
3 changed files with 64 additions and 64 deletions

View File

@ -2,7 +2,7 @@
;; average-balance.scm
;; Report history of account balance and other info
;;
;; Author makes no implicit or explicit guarantee of accuracy of
;; Author makes no implicit or explicit guarantee of accuracy of
;; these calculations and accepts no responsibility for direct
;; or indirect losses incurred as a result of using this software.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -86,7 +86,7 @@
"c" (N_ "Do transaction report on this account.")
(let ((current-accounts '()))
;; If some accounts were selected, use those
(cond ((not (null? current-accounts))
(cond ((not (null? current-accounts))
current-accounts)
(else
;; otherwise get some accounts -- here as an
@ -112,7 +112,7 @@
(gnc-register-list-option options
gnc:pagename-display (N_ "Plot Type")
"c" (N_ "The type of graph to generate.") "AvgBalPlot"
(list
(list
(vector 'AvgBalPlot (N_ "Average"))
(vector 'GainPlot (N_ "Profit"))
(vector 'GLPlot (N_ "Gain/Loss"))))
@ -127,14 +127,14 @@
options))
;;;;;;;;;;;;;;;;;;;;;;;;;
;; Some utilities for generating the data
;; Some utilities for generating the data
;;;;;;;;;;;;;;;;;;;;;;;;;
(define columns
;; Watch out -- these names should be consistent with the display
;; option where you choose them, otherwise users are confused.
(list (G_ "Period start") (G_ "Period end") (G_ "Average")
(G_ "Maximum") (G_ "Minimum") (G_ "Gain")
(list (G_ "Period start") (G_ "Period end") (G_ "Average")
(G_ "Maximum") (G_ "Minimum") (G_ "Gain")
(G_ "Loss") (G_ "Profit") ))
@ -263,17 +263,17 @@
(gnc-optiondb-lookup-value (gnc:report-options report-obj) section name))
(gnc:report-starting reportname)
(let* ((report-title (get-option gnc:pagename-general
(let* ((report-title (get-option gnc:pagename-general
gnc:optname-reportname))
(begindate (gnc:time64-start-day-time
(gnc:date-option-absolute-time
(gnc:date-option-absolute-time
(get-option gnc:pagename-general optname-from-date))))
(enddate (gnc:time64-end-day-time
(gnc:date-option-absolute-time
(enddate (gnc:time64-end-day-time
(gnc:date-option-absolute-time
(get-option gnc:pagename-general optname-to-date))))
(stepsize (gnc:deltasym-to-delta
(get-option gnc:pagename-general optname-stepsize)))
(report-currency (get-option gnc:pagename-general
(report-currency (get-option gnc:pagename-general
optname-report-currency))
(price-source (get-option gnc:pagename-general
optname-price-source))
@ -290,8 +290,8 @@
(document (gnc:make-html-document))
(commodity-list #f)
(exchange-fn #f)
(commodity-list #f)
(exchange-fn #f)
(all-zeros? #t))
;;(warn commodity-list)
@ -307,40 +307,40 @@
;; routine needs to send progress reports, or the price
;; lookup should be distributed and done when actually
;; needed so as to amortize the cpu time properly.
(gnc:report-percent-done 1)
(set! commodity-list (gnc:accounts-get-commodities
(gnc:report-percent-done 1)
(set! commodity-list (gnc:accounts-get-commodities
accounts report-currency))
(gnc:report-percent-done 5)
(set! exchange-fn (gnc:case-exchange-time-fn
price-source report-currency
(gnc:report-percent-done 5)
(set! exchange-fn (gnc:case-exchange-time-fn
price-source report-currency
commodity-list enddate
5 20))
(gnc:report-percent-done 20)
5 20))
(gnc:report-percent-done 20)
;; initialize the query to find splits in the right
;; initialize the query to find splits in the right
;; date range and accounts
(qof-query-set-book query (gnc-get-current-book))
;; for balance purposes, we don't need to do this, but it cleans up
;; the table display.
;; for balance purposes, we don't need to do this, but it cleans up
;; the table display.
(xaccQueryAddClearedMatch
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
;; add accounts to the query (include subaccounts
;; add accounts to the query (include subaccounts
;; if requested)
(gnc:report-percent-done 25)
(gnc:report-percent-done 25)
(xaccQueryAddAccountMatch query accounts QOF-GUID-MATCH-ANY QOF-QUERY-AND)
;; match splits between start and end dates
;; match splits between start and end dates
(xaccQueryAddDateMatchTT
query #t begindate #t enddate QOF-QUERY-AND)
(qof-query-set-sort-order query
(list SPLIT-TRANS TRANS-DATE-POSTED)
(list QUERY-DEFAULT-SORT)
'())
(gnc:report-percent-done 40)
(list SPLIT-TRANS TRANS-DATE-POSTED)
(list QUERY-DEFAULT-SORT)
'())
(gnc:report-percent-done 40)
(let* ((splits (qof-query-run query))
(daily-dates (gnc:make-date-list begindate enddate DayDelta))
@ -380,9 +380,9 @@
internal-included exchange-fn report-currency))))
(gnc:report-percent-done 70)
;; make a plot (optionally)... if both plot and table,
;; plot comes first.
;; make a plot (optionally)... if both plot and table,
;; plot comes first.
(if show-plot?
(let ((barchart (gnc:make-html-chart))
(height (get-option gnc:pagename-display optname-plot-height))
@ -391,7 +391,7 @@
(if (memq 'AvgBalPlot plot-type)
(let
((number-data
(map
(map
(lambda (row) (list-ref row 2)) data)))
(if (not (every zero? number-data))
(begin
@ -402,7 +402,7 @@
(set! all-zeros? #f)))))
(if (memq 'GainPlot plot-type)
(let ((number-data
(let ((number-data
(map (lambda (row) (list-ref row 7)) data)))
(if (not (every zero? number-data))
(begin
@ -413,11 +413,11 @@
(set! all-zeros? #f)))))
(if (memq 'GLPlot plot-type)
(let ((debit-data
(let ((debit-data
(map (lambda (row) (list-ref row 5)) data))
(credit-data
(map (lambda (row) (list-ref row 6)) data)))
;; debit column
;; debit column
(if (not (and
(every zero? debit-data)
(every zero? credit-data)))
@ -431,7 +431,7 @@
credit-data
"#FF4136")
(set! all-zeros? #f)))))
(if (not all-zeros?)
(begin
(gnc:html-chart-set-currency-iso!
@ -447,12 +447,12 @@
(gnc:html-document-add-object! document barchart))
(gnc:html-document-add-object!
document
(gnc:html-make-empty-data-warning
(gnc:html-make-empty-data-warning
report-title (gnc:report-id report-obj))))))
;; make a table (optionally)
(gnc:report-percent-done 80)
(if show-table?
(gnc:report-percent-done 80)
(if show-table?
(let ((table (gnc:make-html-table))
(scu (gnc-commodity-get-fraction report-currency)))
(gnc:html-table-set-col-headers!
@ -478,10 +478,10 @@
(gnc:html-document-add-object! document table))))
;; if there are no accounts selected...
(gnc:html-document-add-object!
(gnc:html-document-add-object!
document
(gnc:html-make-no-account-warning
report-title (gnc:report-id report-obj))))
(gnc:html-make-no-account-warning
report-title (gnc:report-id report-obj))))
(gnc:report-finished)
document))

View File

@ -6,16 +6,16 @@
;; based on account-piecharts.scm by Robert Merkel (rgmerk@mira.net)
;; and Christian Stimming <stimming@tu-harburg.de>
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
@ -40,7 +40,7 @@
;; The menu statusbar tips.
(define menutip-income
(N_ "Shows a piechart with the total income for each day of the week"))
(define menutip-expense
(define menutip-expense
(N_ "Shows a piechart with the total expenses for each day of the week"))
;; The names here are used 1. for internal identification, 2. as
@ -171,8 +171,8 @@
;; routine needs to send progress reports, or the price
;; lookup should be distributed and done when actually
;; needed so as to amortize the cpu time properly.
(gnc:report-percent-done 1)
(set! commodity-list (gnc:accounts-get-commodities
(gnc:report-percent-done 1)
(set! commodity-list (gnc:accounts-get-commodities
(gnc-accounts-and-all-descendants accounts)
report-currency))
(gnc:report-percent-done 5)
@ -212,7 +212,7 @@
;; get the query results
(set! splits (qof-query-run query))
(qof-query-destroy query)
(gnc:report-percent-done 40)
(gnc:report-percent-done 40)
;; each split is analyzed... the amount is converted to
;; report-currency, and the date modulo 7 used to find
@ -232,7 +232,7 @@
(gnc:report-percent-done 60)
(let* ((zipped-list (filter (lambda (p)
(let* ((zipped-list (filter (lambda (p)
(not (zero? (cadr p))))
(zip days-of-week daily-totals)))
(labels (map (lambda (p)

View File

@ -169,7 +169,7 @@
"c" opthelp-report-title (N_ "Report Title Default"))
;; Setting a default section is optional but set in most reports.
;; If not set, the default section will be the first section.
;; If not set, the default section will be the first section.
(gnc:options-set-default-section options "Tab B")
(GncOptionDBPtr-set-default-section optiondb "Tab B")
;; We still need to return the function wrapper instead of the GncOptionDBPtr for all of the options functions in the reports system.
@ -465,4 +465,4 @@ new, totally cool report, consult the mailing list ~a.")
;; The rendering function defined above.
'renderer sample-report-renderer)