Prepare for notifications.
This commit is contained in:
parent
ac3dce41a6
commit
1551ea15e6
3 changed files with 27 additions and 5 deletions
|
@ -32,6 +32,7 @@
|
|||
members-payments-process
|
||||
member-balance
|
||||
member-total-balance
|
||||
members-to-notify
|
||||
)
|
||||
|
||||
(import scheme
|
||||
|
@ -211,5 +212,17 @@
|
|||
(else 0))))
|
||||
(member-payments mr))))
|
||||
|
||||
;; Return members to notify because of late payments for more than
|
||||
;; given number of months
|
||||
(define (members-to-notify mb months)
|
||||
(filter-members-by-predicate
|
||||
mb
|
||||
(lambda (mr)
|
||||
(let ((total (member-total-balance mr))
|
||||
(fee (lookup-member-fee (if (member-student? mr)
|
||||
'student
|
||||
'regular))))
|
||||
(and (< total 0)
|
||||
(< total (- (* months fee))))))))
|
||||
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue