Start work on limiting the number of payments in default member display.

This commit is contained in:
Dominik Pantůček 2023-06-30 17:22:08 +02:00
parent 8bebe6095e
commit d39c8353ee
2 changed files with 18 additions and 15 deletions

View file

@ -188,7 +188,8 @@ MEMBERS-PRINT-SOURCES=members-print.scm util-dict-list.import.scm \
bank-account.import.scm members-fees.import.scm \ bank-account.import.scm members-fees.import.scm \
members-payments.import.scm brmember-format.import.scm \ members-payments.import.scm brmember-format.import.scm \
specification.import.scm cal-format.import.scm \ specification.import.scm cal-format.import.scm \
util-git.import.scm util-list.import.scm util-git.import.scm util-list.import.scm \
racket-kwargs.import.scm
members-print.o: members-print.import.scm members-print.o: members-print.import.scm
members-print.import.scm: $(MEMBERS-PRINT-SOURCES) members-print.import.scm: $(MEMBERS-PRINT-SOURCES)

View file

@ -65,7 +65,8 @@
specification specification
cal-format cal-format
util-git util-git
cal-day) cal-day
racket-kwargs)
;; Returns nicely formatted table ;; Returns nicely formatted table
(define (member-info->table mr) (define (member-info->table mr)
@ -217,19 +218,20 @@
))) )))
;; Prints nicely printed payments ;; Prints nicely printed payments
(define (member-payments->table mr) (define* (member-payments->table mr (max-trans #f))
(table->string (cons (let ((payments (brmember-payments mr)))
(list "Var" "Amount" "Cur" "Date" "TrId") (table->string (cons
(map (lambda (tr) (list "Var" "Amount" "Cur" "Date" "TrId")
(list (sprintf "\t~A" (bank-transaction-varsym tr)) (map (lambda (tr)
(sprintf "\t~A" (bank-transaction-amount tr)) (list (sprintf "\t~A" (bank-transaction-varsym tr))
(bank-transaction-currency tr) (sprintf "\t~A" (bank-transaction-amount tr))
(bank-transaction-date tr) (bank-transaction-currency tr)
(bank-transaction-id tr))) (bank-transaction-date tr)
(brmember-payments mr))) (bank-transaction-id tr)))
#:border '(((#:bottom #:right light) ... (#:bottom light)) payments))
((#:right light) ... none) #:border '(((#:bottom #:right light) ... (#:bottom light))
...))) ((#:right light) ... none)
...))))
;; Converts member records to string, optional arguments are format ;; Converts member records to string, optional arguments are format
;; and separator. Format defaults to "~N" and separator to ", ". ;; and separator. Format defaults to "~N" and separator to ", ".