Christian Stimming's report patch.

* src/scm/date-utilities.scm Added (gnc:timepair-previous-day).

	* src/scm/report-utilities.scm (gnc:account-get-balance-interval)
	Fix bug with start date.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3624 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-02-08 22:10:16 +00:00
parent fc5dd365ae
commit a016811048
4 changed files with 20 additions and 11 deletions

View File

@ -1,5 +1,10 @@
2001-02-08 Christian Stimming <stimming@tuhh.de> 2001-02-08 Christian Stimming <stimming@tuhh.de>
* src/scm/date-utilities.scm Added (gnc:timepair-previous-day).
* src/scm/report-utilities.scm (gnc:account-get-balance-interval)
Fix bug with start date.
* src/scm/html-style-info.scm: Fix bug. * src/scm/html-style-info.scm: Fix bug.
* src/scm/gnc-numeric.scm: Add more functions on gnc-monetary. * src/scm/gnc-numeric.scm: Add more functions on gnc-monetary.

View File

@ -297,6 +297,9 @@
(let ((newtime (car (mktime bdt)))) (let ((newtime (car (mktime bdt))))
(cons newtime 0)))) (cons newtime 0))))
(define (gnc:timepair-previous-day tp)
(decdate tp DayDelta))
(define (gnc:reldate-get-symbol x) (vector-ref x 0)) (define (gnc:reldate-get-symbol x) (vector-ref x 0))
(define (gnc:reldate-get-string x) (vector-ref x 1)) (define (gnc:reldate-get-string x) (vector-ref x 1))
(define (gnc:reldate-get-desc x) (vector-ref x 2)) (define (gnc:reldate-get-desc x) (vector-ref x 2))

View File

@ -58,10 +58,6 @@
;; loss reports). Returns a commodity-collector. ;; loss reports). Returns a commodity-collector.
(define (my-get-balance account) (define (my-get-balance account)
(if start-date (if start-date
;; FIXME: the get-balance-interval function uses this date
;; rightaway, but since it calculates a difference it should
;; rather take the end-day-time of one day before that. This
;; needs to be fixed in report-utilities.scm.
(gnc:account-get-comm-balance-interval (gnc:account-get-comm-balance-interval
account start-date end-date do-subtot?) account start-date end-date do-subtot?)
(gnc:account-get-comm-balance-at-date (gnc:account-get-comm-balance-at-date

View File

@ -500,20 +500,25 @@
;; this isn't quite as efficient as it could be, but it's a whole lot ;; this isn't quite as efficient as it could be, but it's a whole lot
;; simpler :) ;; simpler :)
(define (gnc:account-get-balance-interval account from to include-children?) (define (gnc:account-get-balance-interval account from to include-children?)
;; FIXME: the get-balance-interval function uses this date ;; Since this function calculates a balance difference it has to
;; rightaway, but since it calculates a difference it should ;; subtract the balance of the previous day's end (from-date)
;; rather take the end-day-time of one day before that. This ;; instead of the plain date.
;; needs to be fixed in report-utilities.scm.
(- (gnc:account-get-balance-at-date account to include-children?) (- (gnc:account-get-balance-at-date account to include-children?)
(gnc:account-get-balance-at-date account from include-children?))) (gnc:account-get-balance-at-date
account
(gnc:timepair-end-day-time (gnc:timepair-previous-day from))
include-children?)))
;; the version which returns a commodity-collector ;; the version which returns a commodity-collector
(define (gnc:account-get-comm-balance-interval (define (gnc:account-get-comm-balance-interval
account from to include-children?) account from to include-children?)
(let ((this-collector (gnc:account-get-comm-balance-at-date (let ((this-collector (gnc:account-get-comm-balance-at-date
account to include-children?))) account to include-children?)))
(this-collector 'minusmerge (gnc:account-get-comm-balance-at-date (this-collector
account from include-children?) #f) 'minusmerge (gnc:account-get-comm-balance-at-date
account
(gnc:timepair-end-day-time (gnc:timepair-previous-day from))
include-children?) #f)
this-collector)) this-collector))
(define (gnc:group-get-balance-interval group from to) (define (gnc:group-get-balance-interval group from to)