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)))
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
(define (gnc:convert-split-list split-array)
(let loop ((index 0)
@ -118,18 +115,6 @@
(gnc:ith-split split-array (+ index 1))
(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)
; ;; You must call gnc:group-reset-write-flags on the account group
; ;; before using this...

View File

@ -46,22 +46,10 @@
"Report Options" "Account"
"b" "Report on these account(s)"
(lambda ()
(let ((current-accounts (gnc:get-current-accounts))
(num-accounts
(gnc:group-get-num-accounts (gnc:get-current-group))))
(let ((current-accounts (gnc:get-current-accounts)))
(cond ((not (null? current-accounts)) current-accounts)
(else
(let ((acctlist '()))
(gnc:for-loop
(lambda(x)
(set! acctlist
(append!
acctlist
(list (gnc:group-get-account
(gnc:get-current-group) x)))))
0 num-accounts 1)
acctlist)))))
(gnc:group-get-account-list (gnc:get-current-group))))))
#f #t))
(gnc:register-accsum-option
@ -99,7 +87,8 @@
(else
(string-append
"<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>"))))
;; Create an html table from a list of rows, each containing
@ -120,12 +109,6 @@
(define (accsum_html-table-footer)
"</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 (column-list)
@ -157,7 +140,8 @@
(string-append (gnc:account-get-name account)
(acc-sum-table
(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:amount->string acc-bal
(gnc:account-value-print-info account #t)))))
@ -176,9 +160,8 @@
;; all children are included in the calculation
(define (account-total-at-date accnts date)
(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)
(let ((acctcurrency "USD")

View File

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