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
|
(module
|
||||||
members-print
|
members-print
|
||||||
(
|
(
|
||||||
|
*show-payments-count*
|
||||||
print-member-table
|
print-member-table
|
||||||
print-member-source
|
print-member-source
|
||||||
print-member-blame
|
print-member-blame
|
||||||
|
@ -68,6 +69,8 @@
|
||||||
cal-day
|
cal-day
|
||||||
racket-kwargs)
|
racket-kwargs)
|
||||||
|
|
||||||
|
(define *show-payments-count* (make-parameter #f))
|
||||||
|
|
||||||
;; Returns nicely formatted table
|
;; Returns nicely formatted table
|
||||||
(define (member-info->table mr)
|
(define (member-info->table mr)
|
||||||
(let* ((aliases (ldict-ref mr 'symlinks))
|
(let* ((aliases (ldict-ref mr 'symlinks))
|
||||||
|
@ -218,8 +221,20 @@
|
||||||
)))
|
)))
|
||||||
|
|
||||||
;; Prints nicely printed payments
|
;; Prints nicely printed payments
|
||||||
(define* (member-payments->table mr (max-trans #f))
|
(define* (member-payments->table mr (max-trans (*show-payments-count*)))
|
||||||
(let ((payments (brmember-payments mr)))
|
(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
|
(table->string (cons
|
||||||
(list "Var" "Amount" "Cur" "Date" "TrId")
|
(list "Var" "Amount" "Cur" "Date" "TrId")
|
||||||
(map (lambda (tr)
|
(map (lambda (tr)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue