mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-26 02:40:43 -06:00
Robert Graham Merkel's report updates for relative dates.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2733 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
97935e3e0c
commit
a11ffa70df
@ -1,3 +1,11 @@
|
||||
2000-08-31 Robert Graham Merkel <rgmerk@mira.net>
|
||||
|
||||
* src/scm/report/balance-and-pnl.scm: Bug fixes for new date options.
|
||||
|
||||
* src/scm/report/transaction-report.scm: Bug fixes for new date options.
|
||||
|
||||
* src/scm/report/budget-report.scm: Bug fixes for new date options.
|
||||
|
||||
2000-08-30 Robert Graham Merkel <rgmerk@mira.net>
|
||||
|
||||
* src/scm/report/hello-world.scm: A couple of new functions to test the relative
|
||||
|
@ -47,7 +47,7 @@
|
||||
(set-tm:min bdtime 59)
|
||||
(set-tm:hour bdtime 23)
|
||||
(let ((time (car (mktime bdtime))))
|
||||
(cons 'absolute(cons time 0)))))
|
||||
(cons 'absolute (cons time 0)))))
|
||||
#f 'absolute #f))
|
||||
gnc:*balsht-report-options*)
|
||||
|
||||
@ -68,8 +68,8 @@
|
||||
(set-tm:mday bdtime 1)
|
||||
(set-tm:mon bdtime 0)
|
||||
(let ((time (car (mktime bdtime))))
|
||||
(cons time 0))))
|
||||
#f))
|
||||
(cons 'absolute (cons time 0)))))
|
||||
#f 'absolute #f))
|
||||
|
||||
(gnc:register-pnl-option
|
||||
(gnc:make-date-option
|
||||
|
@ -744,16 +744,16 @@
|
||||
(set-tm:mday bdtime 1)
|
||||
(set-tm:mon bdtime 0)
|
||||
(let ((time (car (mktime bdtime))))
|
||||
(cons time 0))))
|
||||
#f))
|
||||
(cons 'absolute (cons time 0)))))
|
||||
#f 'absolute #f))
|
||||
|
||||
;; to-date
|
||||
(gnc:register-budget-report-option
|
||||
(gnc:make-date-option
|
||||
"Report Options" "To"
|
||||
"b" "Report end date"
|
||||
(lambda () (cons (current-time) 0))
|
||||
#f))
|
||||
(lambda () (cons 'absolute (cons (current-time) 0)))
|
||||
#f 'absolute #f))
|
||||
|
||||
;; view
|
||||
(gnc:register-budget-report-option
|
||||
@ -1133,9 +1133,9 @@
|
||||
(let* ((begindate (gnc:lookup-option options "Report Options" "From"))
|
||||
(enddate (gnc:lookup-option options "Report Options" "To"))
|
||||
(begin-date-secs (car (gnc:timepair-canonical-day-time
|
||||
(gnc:option-value begindate))))
|
||||
(gnc:date-option-absolute-time (gnc:option-value begindate)))))
|
||||
(end-date-secs (car (gnc:timepair-canonical-day-time
|
||||
(gnc:option-value enddate))))
|
||||
(gnc:date-option-absolute-time (gnc:option-value enddate)))))
|
||||
(budget-hash (make-hash-table 313))
|
||||
(budget-list
|
||||
(map
|
||||
|
@ -404,10 +404,9 @@
|
||||
(define gnc:*transaction-report-options* (gnc:new-options))
|
||||
(define (gnc:register-trep-option new-option)
|
||||
(gnc:register-option gnc:*transaction-report-options* new-option))
|
||||
|
||||
;; from date
|
||||
;; hack alert - could somebody set this to an appropriate date?
|
||||
(display "Got here 1")
|
||||
|
||||
(gnc:register-trep-option
|
||||
(gnc:make-date-option
|
||||
"Report Options" "From"
|
||||
@ -421,9 +420,10 @@
|
||||
(set-tm:mon bdtime 0)
|
||||
(let ((time (car (mktime bdtime))))
|
||||
(cons 'absolute (cons time 0)))))
|
||||
#f 'absolute #f))
|
||||
(display "Got here 1a")
|
||||
#f 'absolute #f))
|
||||
|
||||
;; to-date
|
||||
|
||||
(gnc:register-trep-option
|
||||
(gnc:make-date-option
|
||||
"Report Options" "To"
|
||||
@ -447,7 +447,6 @@
|
||||
(else ()))))
|
||||
#f #t))
|
||||
|
||||
(display "got here 2")
|
||||
(gnc:register-trep-option
|
||||
(gnc:make-multichoice-option
|
||||
"Report Options" "Style"
|
||||
@ -522,7 +521,7 @@
|
||||
(list
|
||||
#(ascend "Ascending" "smallest to largest, earliest to latest")
|
||||
#(descend "Descending" "largest to smallest, latest to earliest"))))
|
||||
(display "Got here 3")
|
||||
|
||||
(gnc:register-trep-option
|
||||
(gnc:make-multichoice-option
|
||||
"Sorting" "Secondary Key"
|
||||
@ -540,6 +539,7 @@
|
||||
#(ascend "Ascending" "smallest to largest, earliest to latest")
|
||||
#(descend "Descending" "largest to smallest, latest to earliest")))))
|
||||
|
||||
|
||||
(gnc:register-trep-option
|
||||
(gnc:make-simple-boolean-option
|
||||
"Display" "Date"
|
||||
@ -573,7 +573,8 @@
|
||||
(gnc:register-trep-option
|
||||
(gnc:make-multichoice-option
|
||||
"Display" "Amount"
|
||||
"i" "Display the amount?"
|
||||
"i" "Display the amount?"
|
||||
|
||||
'single
|
||||
(list #(none "None" "No amount display")
|
||||
#(single "Single" "Single Column Display")
|
||||
@ -581,8 +582,8 @@
|
||||
|
||||
(gnc:register-trep-option
|
||||
(gnc:make-simple-boolean-option
|
||||
"Display" "Headers"
|
||||
"j" "Display the headers?" #t))
|
||||
"Display" "Headers" "j" "Display the headers?" #t))
|
||||
|
||||
|
||||
(gnc:register-trep-option
|
||||
(gnc:make-simple-boolean-option
|
||||
@ -591,15 +592,13 @@
|
||||
|
||||
(gnc:options-set-default-section gnc:*transaction-report-options*
|
||||
"Report Options")
|
||||
(display "tr-report-options =")
|
||||
(display gnc:*transaction-report-options*)
|
||||
(display "\n")
|
||||
|
||||
gnc:*transaction-report-options*)
|
||||
|
||||
|
||||
(define (gnc:trep-renderer options)
|
||||
(let* ((begindate (gnc:date-option-absolute-time (gnc:lookup-option options "Report Options" "From")))
|
||||
(enddate (gnc:date-option-absolute-time (gnc:lookup-option options "Report Options" "To")))
|
||||
(let* ((begindate (gnc:date-option-absolute-time (gnc:option-value (gnc:lookup-option options "Report Options" "From"))))
|
||||
(enddate (gnc:date-option-absolute-time (gnc:option-value (gnc:lookup-option options "Report Options" "To"))))
|
||||
(tr-report-account-op (gnc:lookup-option
|
||||
options "Report Options" "Account"))
|
||||
(tr-report-primary-key-op (gnc:lookup-option options
|
||||
@ -612,23 +611,23 @@
|
||||
"Sorting"
|
||||
"Secondary Key"))
|
||||
(tr-report-secondary-order-op
|
||||
(gnc:lookup-option options "Sorting" "Secondary Sort Order"))
|
||||
(gnc:lookup-option options "Sorting" "Secondary Sort Order"))
|
||||
(tr-report-style-op (gnc:lookup-option options
|
||||
"Report Options"
|
||||
"Style"))
|
||||
(accounts (gnc:option-value tr-report-account-op))
|
||||
(date-filter-pred (split-report-make-date-filter-predicate
|
||||
(gnc:option-value begindate)
|
||||
(gnc:timepair-end-day-time
|
||||
(gnc:option-value enddate))))
|
||||
(date-filter-pred (split-report-make-date-filter-predicate
|
||||
begindate
|
||||
(gnc:timepair-end-day-time
|
||||
enddate)))
|
||||
(s1 (split-report-get-sort-spec-entry
|
||||
(gnc:option-value tr-report-primary-key-op)
|
||||
(eq? (gnc:option-value tr-report-primary-order-op) 'ascend)
|
||||
(gnc:option-value begindate)))
|
||||
begindate))
|
||||
(s2 (split-report-get-sort-spec-entry
|
||||
(gnc:option-value tr-report-secondary-key-op)
|
||||
(eq? (gnc:option-value tr-report-secondary-order-op) 'ascend)
|
||||
(gnc:option-value begindate)))
|
||||
begindate))
|
||||
(s2b (if s2 (list s2) '()))
|
||||
(sort-specs (if s1 (cons s1 s2b) s2b))
|
||||
(split-list
|
||||
|
Loading…
Reference in New Issue
Block a user