Create member calendar.
This commit is contained in:
parent
a729d2f991
commit
6c8d2c8dbd
5 changed files with 51 additions and 15 deletions
|
@ -28,14 +28,33 @@
|
|||
(module
|
||||
member-fees
|
||||
(
|
||||
member-calender
|
||||
member-calendar
|
||||
member-calendar->fees
|
||||
)
|
||||
|
||||
(import scheme)
|
||||
(import scheme
|
||||
(chicken base)
|
||||
configuration
|
||||
member-record
|
||||
month)
|
||||
|
||||
(define (member-calendar mr)
|
||||
#f)
|
||||
;; Returns a list of months where each month is a list containing:
|
||||
;; * month (from month module)
|
||||
;; * flags - a list of symbols: student, suspended, destroyed
|
||||
;; The list contains all months from 'joined until (*current-month*).
|
||||
(define (member-calendar mr . args)
|
||||
(let ((last-month (if (null? args)
|
||||
(*current-month*)
|
||||
(car args))))
|
||||
(let loop ((cm (member-record-info mr 'joined))
|
||||
(cal '()))
|
||||
(if (month>? cm last-month)
|
||||
(reverse cal)
|
||||
(loop (month-add cm)
|
||||
(cons (list cm
|
||||
(parameterize ((*current-month* cm))
|
||||
(member-flags mr)))
|
||||
cal))))))
|
||||
|
||||
(define (member-calendar->fees mr)
|
||||
#f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue