Add limiter.
This commit is contained in:
parent
d39c8353ee
commit
d989f09595
1 changed files with 17 additions and 2 deletions
|
@ -29,6 +29,7 @@
|
|||
(module
|
||||
members-print
|
||||
(
|
||||
*show-payments-count*
|
||||
print-member-table
|
||||
print-member-source
|
||||
print-member-blame
|
||||
|
@ -68,6 +69,8 @@
|
|||
cal-day
|
||||
racket-kwargs)
|
||||
|
||||
(define *show-payments-count* (make-parameter #f))
|
||||
|
||||
;; Returns nicely formatted table
|
||||
(define (member-info->table mr)
|
||||
(let* ((aliases (ldict-ref mr 'symlinks))
|
||||
|
@ -218,8 +221,20 @@
|
|||
)))
|
||||
|
||||
;; Prints nicely printed payments
|
||||
(define* (member-payments->table mr (max-trans #f))
|
||||
(let ((payments (brmember-payments mr)))
|
||||
(define* (member-payments->table mr (max-trans (*show-payments-count*)))
|
||||
(let* ((payments0 (brmember-payments mr))
|
||||
(payments
|
||||
(if max-trans
|
||||
(let loop ((ps (reverse payments0))
|
||||
(num max-trans)
|
||||
(res '()))
|
||||
(if (or (null? ps)
|
||||
(<= num 0))
|
||||
res
|
||||
(loop (cdr ps)
|
||||
(sub1 num)
|
||||
(cons (car ps) res))))
|
||||
payments0)))
|
||||
(table->string (cons
|
||||
(list "Var" "Amount" "Cur" "Date" "TrId")
|
||||
(map (lambda (tr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue