*** empty log message ***

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2075 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-03-13 06:56:27 +00:00
parent 62dda0e297
commit 1e67e67946
15 changed files with 54 additions and 52 deletions

BIN
Docs/fr/pix/appr-asset1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
Docs/fr/pix/appr-asset2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
Docs/fr/pix/appr-income.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
Docs/fr/pix/appr-main1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
Docs/fr/pix/appr-main2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
Docs/fr/pix/depr-asset.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
Docs/fr/pix/depr-main.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
Docs/fr/pix/reportwin.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -87,6 +87,12 @@
gnc:*debugging?* gnc:*debugging?*
(gnc:config-var-value-get gnc:*debugging?*))) (gnc:config-var-value-get gnc:*debugging?*)))
(define (gnc:setup-debugging)
(if (gnc:debugging?)
(debug-enable 'backtrace)))
(gnc:setup-debugging)
;;;; Status output functions. ;;;; Status output functions.

View File

@ -36,8 +36,7 @@
(display "\n\n" port))))) (display "\n\n" port)))))
(false-if-exception (false-if-exception
(apply display-error #f port args)) (apply display-error #f port args))
;; Here we should write the stack trace. (display-backtrace (fluid-ref the-last-stack) port))
)
(false-if-exception (false-if-exception
(call-with-output-string write-error))) (call-with-output-string write-error)))

View File

@ -1,5 +1,5 @@
;; -*-scheme-*- ;; -*-scheme-*-
;; $ID$ ;; $Id$
;; dateutils.scm ;; dateutils.scm
;; date utility functions. mainly used by budget ;; date utility functions. mainly used by budget
;; Bryan Larsen (blarsen@ada-works.com) ;; Bryan Larsen (blarsen@ada-works.com)

View File

@ -3,6 +3,8 @@
(if (not (gnc:handle-command-line-args)) (if (not (gnc:handle-command-line-args))
(gnc:shutdown 1)) (gnc:shutdown 1))
(gnc:setup-debugging)
;; Load the srfis ;; Load the srfis
(gnc:load "srfi/srfi-8.guile.scm") (gnc:load "srfi/srfi-8.guile.scm")
(gnc:load "srfi/srfi-1.unclear.scm") (gnc:load "srfi/srfi-1.unclear.scm")

View File

@ -19,13 +19,14 @@
;; Options ;; Options
(define (runavg-options-generator) (define (runavg-options-generator)
(let (let*
((gnc:*runavg-track-options* (gnc:new-options)) ((gnc:*runavg-track-options* (gnc:new-options))
;; register a configuration option for the report ;; register a configuration option for the report
(gnc:register-runavg-option (gnc:register-runavg-option
(lambda (new-option) (lambda (new-option)
(gnc:register-option gnc:*runavg-track-options* (gnc:register-option gnc:*runavg-track-options*
new-option)))) new-option))))
;; from date ;; from date
(gnc:register-runavg-option (gnc:register-runavg-option
(gnc:make-date-option (gnc:make-date-option
@ -168,7 +169,7 @@
; Datelist entry operators ; Datelist entry operators
(define (dl:begin dl) (car dl)) (define (dl:begin dl) (car dl))
(define (dl:end dl) (car (cdr dl))) (define (dl:end dl) (car (cdr dl)))
(define (reduce-split-list dl tl pt av) (define (reduce-split-list dl tl pt av)
(let ((stat-accumulator (make-stats-collector)) (let ((stat-accumulator (make-stats-collector))
;;; (avgaccum 0) ;; 'add, 'total, 'average, 'getmax, 'getmin, reset ;;; (avgaccum 0) ;; 'add, 'total, 'average, 'getmax, 'getmin, reset
@ -177,15 +178,14 @@
(gl-accumulator (makedrcr-collector)) (gl-accumulator (makedrcr-collector))
(bals av) (bals av)
(prevdate 0)) (prevdate 0))
;;; procvals goes away
;;; accbal runs the accumulator ;; accbal runs the accumulator
(define (accbal beg end) (define (accbal beg end)
(let ((curbal (vector-sum (car (cdr (av 'x 0)))))) (let ((curbal (vector-sum (car (cdr (av 'x 0))))))
(stat-accumulator 'add (gnc:timepair-delta beg end)))) (stat-accumulator 'add (gnc:timepair-delta beg end))))
(define (calc-in-interval d tl) (define (calc-in-interval d tl)
(cond ((not (null? tl)) (cond ((not (null? tl))
(let* ((bd (dl:begin d)) ; begin date (let* ((bd (dl:begin d)) ; begin date
(ed (dl:end d)) ; end date (ed (dl:end d)) ; end date
(cs (car tl)) ; current split (cs (car tl)) ; current split
@ -193,57 +193,52 @@
(an (gnc:split-get-account-name cs)) ; account name (an (gnc:split-get-account-name cs)) ; account name
(prevbal (vector-sum (car (cdr (av 'x 0)))))) (prevbal (vector-sum (car (cdr (av 'x 0))))))
(cond ((gnc:timepair-later cd bd) ;split before interval (cond ((gnc:timepair-later cd bd) ;split before interval
(bals 'put an (gnc:split-get-balance cs)) (bals 'put an (gnc:split-get-balance cs))
(calc-in-interval d (cdr tl)) (calc-in-interval d (cdr tl)))
)
((gnc:timepair-later cd ed) ;split is in the interval ((gnc:timepair-later cd ed) ;split is in the interval
(accbal prevdate cd) (accbal prevdate cd)
(procvals)
(bals 'put an (gnc:split-get-balance cs)) (bals 'put an (gnc:split-get-balance cs))
(let ((val (gnc:split-get-value cs))) (let ((val (gnc:split-get-value cs)))
(gl-accumulator 'add val)) (gl-accumulator 'add val))
(procvals) ; catch all cases
(set! prevdate cd) (set! prevdate cd)
(calc-in-interval d (cdr tl))) (calc-in-interval d (cdr tl)))
(else ; Past interval, nothing to do? (else ; Past interval, nothing to do?
(accbal prevdate ed) (accbal prevdate ed)
(procvals)
tl)))) tl))))
(else ; Out of data ! (else ; Out of data !
(accbal prevdate (dl:end d)) (accbal prevdate (dl:end d))
(procvals)
tl))) tl)))
;; Actual routine ;; Actual routine
(cond ((null? dl) '());; End of recursion (cond ((null? dl) '());; End of recursion
(else (else
(let* ((bd (dl:begin (car dl))) (let ((bd (dl:begin (car dl)))
(ed (dl:end (car dl))) ) (ed (dl:end (car dl))))
;; Reset valaccumulator values ;; Reset valaccumulator values
(set! prevdate bd) (set! prevdate bd)
(stat-accumulator 'reset #f) (stat-accumulator 'reset #f)
(gl-accumulator 'reset #f) (gl-accumulator 'reset #f)
(let* ((rest (calc-in-interval (car dl) tl))) (let ((rest (calc-in-interval (car dl) tl)))
;; list of values for report ;; list of values for report
(cons (cons
(list (list
(gnc:timepair-to-ldatestring bd) (gnc:timepair-to-ldatestring bd)
(gnc:timepair-to-ldatestring ed) (gnc:timepair-to-ldatestring ed)
(/ (stat-accumulator 'total #f) (/ (stat-accumulator 'total #f)
(gnc:timepair-delta bd ed)) (gnc:timepair-delta bd ed))
(stat-accumulator 'getmin #f) (stat-accumulator 'getmin #f)
(stat-accumulator 'getmax #f) (stat-accumulator 'getmax #f)
(- (gl-accumulator 'debits #f) (- (gl-accumulator 'debits #f)
(gl-accumulator 'credits #f)) (gl-accumulator 'credits #f))
(gl-accumulator 'debits #f) (gl-accumulator 'debits #f)
(gl-accumulator 'credits #f) (gl-accumulator 'credits #f))
(reduce-split-list (cdr dl) rest pt av))))))))) (reduce-split-list (cdr dl) rest pt av))))))))
;; Pull a scheme list of splits from a C array ;; Pull a scheme list of splits from a C array
(define (gnc:convert-split-list slist) (define (gnc:convert-split-list slist)
@ -255,7 +250,7 @@
(cond (cond
((pointer-token-null? asplit ) #f) ((pointer-token-null? asplit ) #f)
(else (else
(set! schsl (append! schsl (list asplit)) ) (set! schsl (append! schsl (list asplit)))
(set! numsplit (+ numsplit 1)) (set! numsplit (+ numsplit 1))
#t))) ()) #t))) ())
schsl)) schsl))
@ -272,7 +267,7 @@
(cond (cond
((pointer-token-null? anact ) #f) ((pointer-token-null? anact ) #f)
(else (else
(set! schal (append! schal (list anact)) ) (set! schal (append! schal (list anact)))
(set! numacct (+ numacct 1)) (set! numacct (+ numacct 1))
#t))) ()) #t))) ())
schal)))) schal))))
@ -287,15 +282,15 @@
;; Add x to list lst if it is not already in there ;; Add x to list lst if it is not already in there
(define (addunique lst x) (define (addunique lst x)
(cond (cond
((null? lst) (list x)) ; all checked add it ((null? lst) (list x)) ; all checked add it
(else (cond (else (cond
((equal? x (car lst)) lst) ; found, quit search and don't add again ((equal? x (car lst)) lst) ; found, quit search and don't add again
(else (cons (car lst) (addunique (cdr lst) x))) ; keep searching (else (cons (car lst) (addunique (cdr lst) x))) ; keep searching
)))) ))))
;; Calculate averages of each column ;; Calculate averages of each column
(define (get-averages indata) (define (get-averages indata)
(let* ((avglst '())) (let ((avglst '()))
(map (lambda (x) (set! avglst (append avglst (list 0.0)))) (car indata)) (map (lambda (x) (set! avglst (append avglst (list 0.0)))) (car indata))
(map (lambda (x) (map (lambda (x)
(set! avglst (accumvects x avglst))) (set! avglst (accumvects x avglst)))
@ -333,8 +328,8 @@
value))))) value)))))
(let ((begindate (gov-fun "From")) (let ((begindate (gov-fun "From"))
(enddate (gov-fun "To")) (enddate (gov-fun "To"))
(stepsize (gov-fun "Step Size")) (stepsize (eval (gov-fun "Step Size")))
(plotstr (gov-fun "Plot Type")) (plotstr (eval (gov-fun "Plot Type")))
(accounts (gov-fun "Account")) (accounts (gov-fun "Account"))
(dosubs (gov-fun "Sub-Accounts")) (dosubs (gov-fun "Sub-Accounts"))
(prefix (list "<HTML>" "<BODY>")) (prefix (list "<HTML>" "<BODY>"))
@ -357,7 +352,7 @@
(begin (begin
; Grab account names ; Grab account names
(set! acctname (string-join (set! acctname (string-join
(map gnc-account-getname accounts) (map gnc:account-get-name accounts)
" , ")) " , "))
(cond ((equal? dosubs #t) (cond ((equal? dosubs #t)
(map (lambda (a) (map (lambda (a)
@ -383,7 +378,7 @@
(display (length report-lines)) (display (length report-lines))
(display " Splits\n") (display " Splits\n")
; Set initial balances to zero ; Set initial balances to zero
(map (lambda(an) (tempstruct 'put an 0)) (map (lambda(an) (tempstruct 'put an 0))
(gnc:acctnames-from-list accounts)) (gnc:acctnames-from-list accounts))
@ -392,7 +387,7 @@
(set! rept-data (set! rept-data
(reduce-split-list (reduce-split-list
(dateloop begindate enddate stepsize) (dateloop begindate enddate stepsize)
report-lines zdate tempstruct)) report-lines (make-zdate) tempstruct))
(set! sum-data (get-averages rept-data)) (set! sum-data (get-averages rept-data))
@ -404,18 +399,18 @@
(list "<TR cellspacing=0><TD><TD><TD colspan=3><HR size=2 noshade><TD colspan=3><HR size=2 noshade></TR>" sum-data)))) (list "<TR cellspacing=0><TD><TD><TD colspan=3><HR size=2 noshade><TD colspan=3><HR size=2 noshade></TR>" sum-data))))
;; Do a plot ;; Do a plot
(if (not (string=? NoPlot plotstr)) (if (not (string=? NoPlot plotstr))
(let (let
((fn "/tmp/gncplot.dat") ((fn "/tmp/gncplot.dat")
(preplot (string-append (preplot (string-append
"set xdata time\n" "set xdata time\n"
"set timefmt '%m/%d/%Y'\n" "set timefmt '%m/%d/%Y'\n"
"set pointsize 2\n" "set pointsize 2\n"
"set title '" acctname "'\n" "set title '" acctname "'\n"
"set ylabel '" acctcurrency "'\n" "set ylabel '" acctcurrency "'\n"
"set xlabel 'Period Ending'\n"))) "set xlabel 'Period Ending'\n")))
(data-to-gpfile collist rept-data fn plotstr) (data-to-gpfile collist rept-data fn plotstr)
(system (system
(string-append "echo \"" preplot "plot '" (string-append "echo \"" preplot "plot '"
fn "'" plotstr fn "'" plotstr