Add boring members to notification email.
This commit is contained in:
parent
cafba67089
commit
70a49c0973
2 changed files with 45 additions and 7 deletions
|
@ -32,6 +32,8 @@
|
|||
members-payments-process
|
||||
member-balance
|
||||
member-total-balance
|
||||
|
||||
member-to-notify?
|
||||
members-to-notify
|
||||
)
|
||||
|
||||
|
@ -213,18 +215,25 @@
|
|||
(else 0))))
|
||||
(brmember-payments mr))))
|
||||
|
||||
;; 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))))))
|
||||
|
||||
;; Return members to notify because of late payments for more than
|
||||
;; given number of months
|
||||
(define (members-to-notify mb months)
|
||||
(find-members-by-predicate
|
||||
mb
|
||||
(lambda (mr)
|
||||
(let ((total (member-total-balance mr))
|
||||
(fee (lookup-member-fee (if (brmember-student? mr)
|
||||
'student
|
||||
'regular))))
|
||||
(and (brmember-active? mr)
|
||||
(< total 0)
|
||||
(< total (- (* months fee))))))))
|
||||
(member-to-notify? mb months))))
|
||||
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue