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