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:")
(format "~A" (length debtor-mrs))
(table->string
(members-attrs-table debtor-mrs
brmember-format
(list "Name" "Balance" "Last Payment")
(list "~N" "\t~B" "~L"))
(append
(members-attrs-table debtor-mrs
brmember-format
(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))
((#:right light) ... none) ...)
((#:right light) ... none) ...
((#:top #:right light) ... (#:top light)))
#:ansi-reset? #t)))
))
#:border '(((#:bottom #:right light) ... (#:bottom light))