|
763 | 763 | ;; it stores a two-element list of commodity collectors:
|
764 | 764 | ;; (list debit-collector credit-collector)
|
765 | 765 | (let* ((row 0)
|
766 |
| - (rows (gnc:html-acct-table-num-rows acct-table))) |
| 766 | + (rows (gnc:html-acct-table-num-rows acct-table)) |
| 767 | + (closing-splits |
| 768 | + (gnc:account-get-trans-type-splits-interval |
| 769 | + all-accounts (list (list 'str closing-str) |
| 770 | + (list 'cased closing-cased) |
| 771 | + (list 'regexp closing-regexp) |
| 772 | + (list 'closing #t)) |
| 773 | + start-date end-date)) |
| 774 | + (adjusting-splits |
| 775 | + (gnc:account-get-trans-type-splits-interval |
| 776 | + all-accounts (list (list 'str adjusting-str) |
| 777 | + (list 'cased adjusting-cased) |
| 778 | + (list 'regexp adjusting-regexp)) |
| 779 | + start-date end-date))) |
| 780 | + |
| 781 | + (define (sum-account-splits account splits) |
| 782 | + (let ((total (gnc:make-commodity-collector)) |
| 783 | + (comm (xaccAccountGetCommodity account))) |
| 784 | + (for-each |
| 785 | + (lambda (s) (total 'add comm (xaccSplitGetAmount s))) |
| 786 | + (filter (lambda (s) (equal? (xaccSplitGetAccount s) account)) |
| 787 | + splits)) |
| 788 | + total)) |
767 | 789 |
|
768 | 790 | (while (< row rows)
|
769 | 791 | (let* ((env (gnc:html-acct-table-get-row-env acct-table row))
|
770 | 792 | (acct (get-val env 'account))
|
771 | 793 | (group (list acct))
|
772 | 794 | (curr-bal (get-val env 'account-bal))
|
773 |
| - (closing |
774 |
| - (gnc:account-get-trans-type-balance-interval-with-closing |
775 |
| - group |
776 |
| - (list (list 'str closing-str) |
777 |
| - (list 'cased closing-cased) |
778 |
| - (list 'regexp closing-regexp) |
779 |
| - (list 'closing #t) |
780 |
| - ) |
781 |
| - start-date end-date |
782 |
| - )) |
783 |
| - (adjusting |
784 |
| - (gnc:account-get-trans-type-balance-interval-with-closing |
785 |
| - group |
786 |
| - (list (list 'str adjusting-str) |
787 |
| - (list 'cased adjusting-cased) |
788 |
| - (list 'regexp adjusting-regexp) |
789 |
| - ) |
790 |
| - start-date end-date |
791 |
| - )) |
| 795 | + (closing (sum-account-splits acct closing-splits)) |
| 796 | + (adjusting (sum-account-splits acct adjusting-splits)) |
792 | 797 | (is? (member acct all-is-accounts))
|
793 | 798 | (ga-or-is? (or (member acct all-ga-accounts) is?))
|
794 | 799 | (pos-adjusting
|
|
0 commit comments