Sort member payments.
This commit is contained in:
parent
d3efbaa82d
commit
3429790dbe
1 changed files with 13 additions and 5 deletions
|
@ -37,6 +37,7 @@
|
|||
(chicken string)
|
||||
(chicken io)
|
||||
(chicken irregex)
|
||||
(chicken sort)
|
||||
bank-account
|
||||
member-record
|
||||
members-base
|
||||
|
@ -115,11 +116,18 @@
|
|||
|
||||
;; Adds all balances - payments are converted to CZK.
|
||||
(define (member-add-balance mr)
|
||||
(dict-set mr
|
||||
(let ((mr0 (dict-set mr
|
||||
'balance
|
||||
(make-dict `((fees . ,(member-fees-total mr))
|
||||
(credit . ,(member-credit-total mr))
|
||||
(payment . ,(member-payments-total mr))))))
|
||||
(payment . ,(member-payments-total mr)))))))
|
||||
(dict-set mr0
|
||||
'payments
|
||||
(sort (dict-ref mr0 'payments '())
|
||||
(lambda (a b)
|
||||
(string<? (bank-transaction-date a)
|
||||
(bank-transaction-date b)))))))
|
||||
|
||||
|
||||
;; Total amount paid
|
||||
(define (member-payments-total mr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue