Preliminary version of attendance sheet.

This commit is contained in:
Dominik Pantůček 2024-12-26 22:20:17 +01:00
parent 53be61d345
commit e02853edc7

View file

@ -48,7 +48,7 @@
(define (print-attendance-sheet MB number) (define (print-attendance-sheet MB number)
(print "\\documentclass[10pt]{article}") (print "\\documentclass[10pt]{article}")
(print "\\usepackage[top=1cm,left=2cm,right=2cm,bottom=2cm]{geometry}") (print "\\usepackage[top=1cm,left=1cm,right=2cm,bottom=2cm]{geometry}")
(print "\\begin{document}") (print "\\begin{document}")
(print "\\begin{center}") (print "\\begin{center}")
(print (print
@ -63,7 +63,7 @@
(print "\\vskip1em") (print "\\vskip1em")
(newline) (newline)
(define colnames (define colnames
'((id) Nick Name Surname (Fee) (Balance) (Active) Signature)) '((id) Nick Name Surname (Fee) (Balance) B (Active) A OK? Signature))
(print (print
(format (format
"\\begin{tabular}{|~A|}" "\\begin{tabular}{|~A|}"
@ -88,6 +88,9 @@
"&") "&")
"\\\\") "\\\\")
(print "\\hline") (print "\\hline")
(define valid-voters 0)
(define ok-balances 0)
(define ok-actives 0)
(let loop ((mrs (find-members-by-predicate (let loop ((mrs (find-members-by-predicate
MB (lambda (mr) MB (lambda (mr)
(brmember-active? mr))))) (brmember-active? mr)))))
@ -122,7 +125,17 @@
(list (*current-month*) (list (*current-month*)
(brmember-flags mr) (brmember-flags mr)
spec-fee)))) spec-fee))))
(balance-ok? (>= (member-total-balance mr)
(- current-fee)))
(active-ok? (>= numactive 9))
(vote-ok? (and balance-ok? active-ok?))
) )
(when balance-ok?
(set! ok-balances (+ ok-balances 1)))
(when active-ok?
(set! ok-actives (+ ok-actives 1)))
(when vote-ok?
(set! valid-voters (+ valid-voters 1)))
(print (print
(brmember-id mr) (brmember-id mr)
" & " " & "
@ -134,19 +147,40 @@
" & " " & "
sname sname
" & " " & "
(format-amount current-fee) current-fee
" & " " & "
(format-amount (format-amount-tex
(member-total-balance mr)) (member-total-balance mr))
" & " " & "
(if balance-ok?
"Y"
"--")
" & "
numactive numactive
" & " " & "
(if active-ok?
"Y"
"--")
" & "
(if vote-ok?
"Y"
"--")
" & "
"~ ~ ~ ~ ~" "~ ~ ~ ~ ~"
" \\\\") " \\\\")
(print "\\hline") (print "\\hline")
(loop (cdr mrs))))) (loop (cdr mrs)))))
(print "\\end{tabular}") (print "\\end{tabular}")
(print "\\end{center}") (print "\\end{center}")
(print "\\end{document}")) (print "\\end{document}")
(print "% valid-voters = " valid-voters)
(print "% valid-balances = " ok-balances)
(print "% valid-actives = " ok-actives)
)
(define (format-amount-tex amt)
(string-translate*
(format-amount amt)
'(("--" . "--{}--"))))
) )