clean up a really ugly piece of scheme code

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17763 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andrew Sackville-West
2008-12-08 22:57:23 +00:00
parent 9cc57ed6b8
commit c32d9b75ef

View File

@@ -650,7 +650,7 @@
account start-date end-date #f)
(gnc:account-get-comm-balance-at-date
account end-date #f)))
(closing (lambda(a)
(closing (lambda(a)
(gnc:account-get-trans-type-balance-interval
(list account) closing-pattern
start-date end-date)
@@ -663,24 +663,27 @@
)
)
)
;; what the heck is this? how about (case balance-mode blah)...
(or (and (equal? balance-mode 'post-closing) post-closing-bal)
(and (equal? balance-mode 'pre-closing)
(let* ((closing-amt (closing account))
)
(post-closing-bal 'minusmerge closing-amt #f)
post-closing-bal)
(cond
((equal? balance-mode 'post-closing)
post-closing-bal)
((equal? balance-mode 'pre-closing)
(let* ((closing-amt (closing account))
)
(and (equal? balance-mode 'pre-adjusting)
(let* ((closing-amt (closing account))
(adjusting-amt (adjusting account))
)
(post-closing-bal 'minusmerge closing-amt #f)
(post-closing-bal 'minusmerge adjusting-amt #f)
post-closing-bal)
)
;; error if we get here.
)
(post-closing-bal 'minusmerge closing-amt #f))
post-closing-bal)
((equal? balance-mode 'pre-adjusting)
(let* ((closing-amt (closing account))
(adjusting-amt (adjusting account))
))
(post-closing-bal 'minusmerge closing-amt #f)
(post-closing-bal 'minusmerge adjusting-amt #f)
post-closing-bal)
(else (begin (display "you fail it")
(newline))))
)
)