Use balance struct and move it to member-print-table.
This commit is contained in:
parent
f9eb053c9a
commit
952fd03f16
2 changed files with 12 additions and 12 deletions
|
@ -169,17 +169,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
(print "Current month: " (month->string (*current-month*)))
|
||||
(newline)
|
||||
(if mr
|
||||
(let ()
|
||||
(print-member-table mr)
|
||||
(let* ((fees (member-fees-total mr))
|
||||
(credit (member-credit-total mr))
|
||||
(payments (member-payments-total mr))
|
||||
(balance (- (+ credit payments) fees)))
|
||||
(print "Total fees: " fees)
|
||||
(print "Total credit: " credit)
|
||||
(print "Total payments: " payments)
|
||||
(print "Balance: " balance)
|
||||
))
|
||||
(print-members-base-table MB))
|
||||
(newline))
|
||||
((print-stats)
|
||||
|
|
|
@ -147,7 +147,17 @@
|
|||
(member-calendar->table mr))
|
||||
)
|
||||
#:row0-border #t
|
||||
#:col-border #t)))
|
||||
#:col-border #t))
|
||||
(let* ((balance (member-balance mr))
|
||||
(fees (dict-ref balance 'fees))
|
||||
(credit (dict-ref balance 'credit))
|
||||
(payment (dict-ref balance 'payment))
|
||||
(total (- (+ credit payment) fees)))
|
||||
(print "Total fees: " fees)
|
||||
(print "Total credit: " credit)
|
||||
(print "Total payments: " payment)
|
||||
(print "Balance: " total)
|
||||
))
|
||||
|
||||
;; Nicely prints the member source with any errors recorded.
|
||||
(define (print-member-source mr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue