Some cleanup. Use new glist functions.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3327 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-12-20 11:19:40 +00:00
parent bbe2d40431
commit a92e9a42bb
3 changed files with 9 additions and 44 deletions

View File

@ -104,9 +104,6 @@
(thunk (gnc:account-get-split account x))) (thunk (gnc:account-get-split account x)))
0 (gnc:account-get-split-count account) 1)) 0 (gnc:account-get-split-count account) 1))
(define (gnc:group-get-accounts group)
(gnc:group-map-accounts (lambda (a) a) group))
;; 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 split-array) (define (gnc:convert-split-list split-array)
(let loop ((index 0) (let loop ((index 0)
@ -118,18 +115,6 @@
(gnc:ith-split split-array (+ index 1)) (gnc:ith-split split-array (+ index 1))
(cons split slist))))) (cons split slist)))))
;; pull a scheme list of splits from an account
(define (gnc:account-get-split-list account)
(let ((num-splits (gnc:account-get-split-count account)))
(let loop ((index 0)
(split (gnc:account-get-split account 0))
(slist '()))
(if (= index num-splits)
(reverse slist)
(loop (+ index 1)
(gnc:account-get-split account (+ index 1))
(cons split slist))))))
; (define (gnc:account-transactions-for-each thunk account) ; (define (gnc:account-transactions-for-each thunk account)
; ;; You must call gnc:group-reset-write-flags on the account group ; ;; You must call gnc:group-reset-write-flags on the account group
; ;; before using this... ; ;; before using this...

View File

@ -46,22 +46,10 @@
"Report Options" "Account" "Report Options" "Account"
"b" "Report on these account(s)" "b" "Report on these account(s)"
(lambda () (lambda ()
(let ((current-accounts (gnc:get-current-accounts)) (let ((current-accounts (gnc:get-current-accounts)))
(num-accounts
(gnc:group-get-num-accounts (gnc:get-current-group))))
(cond ((not (null? current-accounts)) current-accounts) (cond ((not (null? current-accounts)) current-accounts)
(else (else
(let ((acctlist '())) (gnc:group-get-account-list (gnc:get-current-group))))))
(gnc:for-loop
(lambda(x)
(set! acctlist
(append!
acctlist
(list (gnc:group-get-account
(gnc:get-current-group) x)))))
0 num-accounts 1)
acctlist)))))
#f #t)) #f #t))
(gnc:register-accsum-option (gnc:register-accsum-option
@ -99,7 +87,8 @@
(else (else
(string-append (string-append
"<TR>" "<TR>"
(apply string-append (map accsum_html-table-col-align lst align-list)) (apply string-append
(map accsum_html-table-col-align lst align-list))
"</TR>")))) "</TR>"))))
;; Create an html table from a list of rows, each containing ;; Create an html table from a list of rows, each containing
@ -120,12 +109,6 @@
(define (accsum_html-table-footer) (define (accsum_html-table-footer)
"</TABLE>") "</TABLE>")
;; the following should be defined in the report-utilities file (Dave put it there I believe).
;; Just in case I am including it here if your copy of report-utilities doesn't have it
;; un-comment to use
;; (define (gnc:group-get-accounts group)
;; (gnc:group-map-accounts (lambda (a) a) group))
(define string-db (gnc:make-string-database)) (define string-db (gnc:make-string-database))
(define (column-list) (define (column-list)
@ -157,7 +140,8 @@
(string-append (gnc:account-get-name account) (string-append (gnc:account-get-name account)
(acc-sum-table (acc-sum-table
(non-zero-at-date-accounts (non-zero-at-date-accounts
(gnc:group-get-accounts children) date) date #t)) (gnc:group-get-account-list children) date)
date #t))
(gnc:account-get-name account)) (gnc:account-get-name account))
(gnc:amount->string acc-bal (gnc:amount->string acc-bal
(gnc:account-value-print-info account #t))))) (gnc:account-value-print-info account #t)))))
@ -176,9 +160,8 @@
;; all children are included in the calculation ;; all children are included in the calculation
(define (account-total-at-date accnts date) (define (account-total-at-date accnts date)
(apply + (apply +
(map (lambda (account) (d-gnc:account-get-balance-at-date account date #t)) accnts)) (map (lambda (account)
) (d-gnc:account-get-balance-at-date account date #t)) accnts)))
(define (accsum-renderer options) (define (accsum-renderer options)
(let ((acctcurrency "USD") (let ((acctcurrency "USD")

View File

@ -82,10 +82,7 @@
"Report Options" "Account" "Report Options" "Account"
"d" "Do transaction report on this account" "d" "Do transaction report on this account"
(lambda () (lambda ()
(let ((current-accounts (gnc:get-current-accounts)) (let ((current-accounts (gnc:get-current-accounts)))
(num-accounts
(gnc:group-get-num-accounts (gnc:get-current-group))))
(cond ((not (null? current-accounts)) current-accounts) (cond ((not (null? current-accounts)) current-accounts)
(else (else
(gnc:group-get-account-list (gnc:get-current-group)))))) (gnc:group-get-account-list (gnc:get-current-group))))))