Add active debtors table.
This commit is contained in:
parent
ef73cecec5
commit
1eb93de083
2 changed files with 41 additions and 8 deletions
|
@ -331,7 +331,9 @@ 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
|
util-time.import.scm members-fees.import.scm mbase.import.scm \
|
||||||
|
members-print.import.scm table.import.scm \
|
||||||
|
bank-account.import.scm
|
||||||
|
|
||||||
notifications.o: notifications.import.scm
|
notifications.o: notifications.import.scm
|
||||||
notifications.import.scm: $(NOTIFICATIONS-SOURCES)
|
notifications.import.scm: $(NOTIFICATIONS-SOURCES)
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
(import scheme
|
(import scheme
|
||||||
(chicken base)
|
(chicken base)
|
||||||
(chicken format)
|
(chicken format)
|
||||||
|
(chicken string)
|
||||||
brmember
|
brmember
|
||||||
util-mail
|
util-mail
|
||||||
util-dict-list
|
util-dict-list
|
||||||
|
@ -48,7 +49,8 @@
|
||||||
members-fees
|
members-fees
|
||||||
mbase
|
mbase
|
||||||
members-print
|
members-print
|
||||||
table)
|
table
|
||||||
|
bank-account)
|
||||||
|
|
||||||
;; Prints email to the console
|
;; Prints email to the console
|
||||||
(define (print-notification-email em)
|
(define (print-notification-email em)
|
||||||
|
@ -131,9 +133,38 @@
|
||||||
(append
|
(append
|
||||||
(list ""
|
(list ""
|
||||||
"Unpaired transactions:")
|
"Unpaired transactions:")
|
||||||
(unpaired-table mb #:border-style 'ascii)))))
|
(unpaired-table mb #:border-style 'ascii))))
|
||||||
|
(debtors (members-to-notify mb 1))
|
||||||
|
(debtors-lst
|
||||||
|
(if (null? debtors)
|
||||||
|
'()
|
||||||
|
(append
|
||||||
|
(list ""
|
||||||
|
"Active debtors:")
|
||||||
|
(table->list
|
||||||
|
(cons (list "Id" "Member" "Type" "Balance" "Last payment")
|
||||||
|
(map (lambda (mr)
|
||||||
|
(list (brmember-id mr)
|
||||||
|
(brmember-nick mr)
|
||||||
|
(if (brmember-student? mr)
|
||||||
|
'student
|
||||||
|
'normal)
|
||||||
|
(format "\t~A" (member-total-balance mr))
|
||||||
|
(let* ((payments (brmember-payments mr))
|
||||||
|
(tr (if (null? payments)
|
||||||
|
#f
|
||||||
|
(car (reverse payments)))))
|
||||||
|
(if tr
|
||||||
|
(bank-transaction-date tr)
|
||||||
|
"-"))
|
||||||
|
))
|
||||||
|
debtors))
|
||||||
|
#:border-style 'ascii
|
||||||
|
#:col-border #t
|
||||||
|
#:row0-border #t)))))
|
||||||
(append income-lst
|
(append income-lst
|
||||||
unpaired-lst)))
|
unpaired-lst
|
||||||
|
debtors-lst)))
|
||||||
|
|
||||||
;; Creates the summary email structure
|
;; Creates the summary email structure
|
||||||
(define (make-summary-email mb)
|
(define (make-summary-email mb)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue