mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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))))
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user