Calculate total credit with current month restriction in place.
This commit is contained in:
parent
cbd17399e3
commit
d5ac70b95a
2 changed files with 10 additions and 2 deletions
|
@ -84,7 +84,7 @@
|
|||
(*members-directory* dir))
|
||||
(-month (YYYY-MM) "Specify current month"
|
||||
(-normal-month- #f)
|
||||
(*current-month* (string->month YYYY-MM)))
|
||||
(*current-month* (string->cal-month YYYY-MM)))
|
||||
(-tstyle (style) "Use given table style: debug, ascii, unicode"
|
||||
(*table-border-style* (string->symbol style)))
|
||||
(-apikey (fname) "File with Fio API keys"
|
||||
|
|
|
@ -163,7 +163,15 @@
|
|||
|
||||
;; Total credit manually recorded in member record
|
||||
(define (member-credit-total mr)
|
||||
(let* ((credit (brmember-info mr 'credit '()))
|
||||
(let* ((credit (filter (lambda (cr)
|
||||
(let* ((cmon (cadr cr))
|
||||
(mon (if cmon
|
||||
(cal-ensure-month cmon)
|
||||
#f)))
|
||||
(if mon
|
||||
(cal-month<=? mon (*current-month*))
|
||||
#t)))
|
||||
(brmember-info mr 'credit '())))
|
||||
(amounts (map car credit)))
|
||||
(foldl + 0 amounts)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue