Work only with active members in notifications.

This commit is contained in:
Dominik Pantůček 2023-04-23 13:30:36 +02:00
parent 70a49c0973
commit 2e873ab8ba

View file

@ -217,16 +217,18 @@
;; Returns true if given member should be notified in given number of months
(define (member-to-notify? mr . mmonths)
(let ((months (if (null? mmonths)
1
(car mmonths)))
(total (member-total-balance mr))
(fee (lookup-member-fee (if (brmember-student? mr)
'student
'regular))))
(and (brmember-active? mr)
(< total 0)
(< total (- (* months fee))))))
(if (member-active? mr)
(let ((months (if (null? mmonths)
1
(car mmonths)))
(total (member-total-balance mr))
(fee (lookup-member-fee (if (brmember-student? mr)
'student
'regular))))
(and (brmember-active? mr)
(< total 0)
(< total (- (* months fee)))))
#f))
;; Return members to notify because of late payments for more than
;; given number of months