Update notifications dependencies.
This commit is contained in:
parent
09bce0be88
commit
5200b26685
3 changed files with 38 additions and 14 deletions
|
@ -201,7 +201,8 @@ members-print.import.scm: $(MEMBERS-PRINT-SOURCES)
|
||||||
|
|
||||||
MEMBERS-FEES-SOURCES=members-fees.scm configuration.import.scm \
|
MEMBERS-FEES-SOURCES=members-fees.scm configuration.import.scm \
|
||||||
brmember.import.scm month.import.scm table.import.scm \
|
brmember.import.scm month.import.scm table.import.scm \
|
||||||
mbase.import.scm specification.import.scm
|
mbase.import.scm specification.import.scm \
|
||||||
|
util-list.import.scm
|
||||||
|
|
||||||
members-fees.o: members-fees.import.scm
|
members-fees.o: members-fees.import.scm
|
||||||
members-fees.import.scm: $(MEMBERS-FEES-SOURCES)
|
members-fees.import.scm: $(MEMBERS-FEES-SOURCES)
|
||||||
|
@ -329,7 +330,8 @@ util-mail.import.scm: $(UTIL-MAIL-SOURCES)
|
||||||
NOTIFICATIONS-SOURCES=notifications.scm brmember.import.scm \
|
NOTIFICATIONS-SOURCES=notifications.scm brmember.import.scm \
|
||||||
util-mail.import.scm util-dict-list.import.scm \
|
util-mail.import.scm util-dict-list.import.scm \
|
||||||
members-payments.import.scm util-format.import.scm \
|
members-payments.import.scm util-format.import.scm \
|
||||||
brmember-format.import.scm configuration.import.scm
|
brmember-format.import.scm configuration.import.scm \
|
||||||
|
util-time.import.scm members-fees.import.scm
|
||||||
|
|
||||||
notifications.o: notifications.import.scm
|
notifications.o: notifications.import.scm
|
||||||
notifications.import.scm: $(NOTIFICATIONS-SOURCES)
|
notifications.import.scm: $(NOTIFICATIONS-SOURCES)
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
member-fees-total
|
member-fees-total
|
||||||
member-credit-total
|
member-credit-total
|
||||||
member-calendar->table
|
member-calendar->table
|
||||||
|
members-summary
|
||||||
)
|
)
|
||||||
|
|
||||||
(import scheme
|
(import scheme
|
||||||
|
@ -51,7 +52,8 @@
|
||||||
table
|
table
|
||||||
mbase
|
mbase
|
||||||
period
|
period
|
||||||
specification)
|
specification
|
||||||
|
util-list)
|
||||||
|
|
||||||
;; Returns a matching list of (list regular student)
|
;; Returns a matching list of (list regular student)
|
||||||
(define (lookup-member-fees)
|
(define (lookup-member-fees)
|
||||||
|
@ -168,15 +170,26 @@
|
||||||
;; Nicely print calendar for given member
|
;; Nicely print calendar for given member
|
||||||
(define (member-calendar->table mr)
|
(define (member-calendar->table mr)
|
||||||
(let* ((mc (member-calendar mr))
|
(let* ((mc (member-calendar mr))
|
||||||
(fees (member-calendar->fees mc)))
|
(fees (member-calendar->fees mc)))
|
||||||
(table->string (cons (map (lambda (c)
|
(table->string (cons (map (lambda (c)
|
||||||
(sprintf "\t~A\t" c))
|
(sprintf "\t~A\t" c))
|
||||||
(list "" 1 2 3 4 5 6 7 8 9 10 11 12))
|
(list "" 1 2 3 4 5 6 7 8 9 10 11 12))
|
||||||
(member-calendar->years-table mc))
|
(member-calendar->years-table mc))
|
||||||
#:table-border #f
|
#:table-border #f
|
||||||
#:row-border #t
|
#:row-border #t
|
||||||
#:col-border #t
|
#:col-border #t
|
||||||
#:ansi #t
|
#:ansi #t
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
;; Summarizes (cons students full) counts
|
||||||
|
(define (members-summary mb)
|
||||||
|
(let ((members (filter
|
||||||
|
brmember-active?
|
||||||
|
(mbase-members mb))))
|
||||||
|
(foldl (lambda (acc mr)
|
||||||
|
(cons (+ (car acc) (if (brmember-student? mr) 1 0))
|
||||||
|
(+ (cdr acc) (if (brmember-student? mr) 0 1))))
|
||||||
|
(cons 0 0)
|
||||||
|
members)))
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -44,7 +44,8 @@
|
||||||
util-format
|
util-format
|
||||||
brmember-format
|
brmember-format
|
||||||
configuration
|
configuration
|
||||||
util-time)
|
util-time
|
||||||
|
members-fees)
|
||||||
|
|
||||||
;; Prints email to the console
|
;; Prints email to the console
|
||||||
(define (print-notification-email em)
|
(define (print-notification-email em)
|
||||||
|
@ -109,9 +110,17 @@
|
||||||
(let ((em (make-reminder-email mr)))
|
(let ((em (make-reminder-email mr)))
|
||||||
(send-notification-email em)))
|
(send-notification-email em)))
|
||||||
|
|
||||||
|
;; Summary email of membership fees payments
|
||||||
(define (summary-email-body mb)
|
(define (summary-email-body mb)
|
||||||
'("yyy"))
|
(let* ((mbs (members-summary mb))
|
||||||
|
(students (car mbs))
|
||||||
|
(full (cdr mbs)))
|
||||||
|
(list (format "Expected income: ~A" 0)
|
||||||
|
(format " ~A full members" full)
|
||||||
|
(format " ~A students" students)
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Creates the summary email structure
|
||||||
(define (make-summary-email mb)
|
(define (make-summary-email mb)
|
||||||
(make-ldict
|
(make-ldict
|
||||||
`((to . ,(*summary-mailto*))
|
`((to . ,(*summary-mailto*))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue