Prepare for notifications.

This commit is contained in:
Dominik Pantůček 2023-04-08 21:53:48 +02:00
parent ac3dce41a6
commit 1551ea15e6
3 changed files with 27 additions and 5 deletions

View file

@ -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))))))))
)