Add total debt display to -info.

This commit is contained in:
Dominik Pantůček 2023-09-16 08:17:44 +02:00
parent 54497b8bc8
commit 878f64f00c

View file

@ -372,12 +372,24 @@
(list (ansi-string "\t" #:magenta #:bold "Debtors:") (list (ansi-string "\t" #:magenta #:bold "Debtors:")
(format "~A" (length debtor-mrs)) (format "~A" (length debtor-mrs))
(table->string (table->string
(members-attrs-table debtor-mrs (append
brmember-format (members-attrs-table debtor-mrs
(list "Name" "Balance" "Last Payment") brmember-format
(list "~N" "\t~B" "~L")) (list "Name" "Balance" "Last Payment")
(list "~N" "\t~B" "~L"))
(list
(list
"Total"
(format
"\t~A"
(foldr
(lambda (v a)
(+ (member-total-balance v) a))
0
debtor-mrs)))))
#:border '(((#:bottom #:right light) ... (#:bottom light)) #:border '(((#:bottom #:right light) ... (#:bottom light))
((#:right light) ... none) ...) ((#:right light) ... none) ...
((#:top #:right light) ... (#:top light)))
#:ansi-reset? #t))) #:ansi-reset? #t)))
)) ))
#:border '(((#:bottom #:right light) ... (#:bottom light)) #:border '(((#:bottom #:right light) ... (#:bottom light))