mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
fc5dd365ae
commit
a016811048
@ -1,5 +1,10 @@
|
||||
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/gnc-numeric.scm: Add more functions on gnc-monetary.
|
||||
|
@ -297,6 +297,9 @@
|
||||
(let ((newtime (car (mktime bdt))))
|
||||
(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-string x) (vector-ref x 1))
|
||||
(define (gnc:reldate-get-desc x) (vector-ref x 2))
|
||||
|
@ -58,10 +58,6 @@
|
||||
;; loss reports). Returns a commodity-collector.
|
||||
(define (my-get-balance account)
|
||||
(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
|
||||
account start-date end-date do-subtot?)
|
||||
(gnc:account-get-comm-balance-at-date
|
||||
|
@ -500,20 +500,25 @@
|
||||
;; this isn't quite as efficient as it could be, but it's a whole lot
|
||||
;; simpler :)
|
||||
(define (gnc:account-get-balance-interval account from to include-children?)
|
||||
;; 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.
|
||||
;; Since this function calculates a balance difference it has to
|
||||
;; subtract the balance of the previous day's end (from-date)
|
||||
;; instead of the plain date.
|
||||
(- (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
|
||||
(define (gnc:account-get-comm-balance-interval
|
||||
account from to include-children?)
|
||||
(let ((this-collector (gnc:account-get-comm-balance-at-date
|
||||
account to include-children?)))
|
||||
(this-collector 'minusmerge (gnc:account-get-comm-balance-at-date
|
||||
account from include-children?) #f)
|
||||
(this-collector
|
||||
'minusmerge (gnc:account-get-comm-balance-at-date
|
||||
account
|
||||
(gnc:timepair-end-day-time (gnc:timepair-previous-day from))
|
||||
include-children?) #f)
|
||||
this-collector))
|
||||
|
||||
(define (gnc:group-get-balance-interval group from to)
|
||||
|
Loading…
Reference in New Issue
Block a user