Start fees table rework using new primitives.
This commit is contained in:
parent
ea9c76d2fc
commit
f2e47b9ad3
5 changed files with 101 additions and 88 deletions
|
|
@ -67,8 +67,6 @@
|
|||
|
||||
member-record-add-payment
|
||||
member-payments
|
||||
member-balance
|
||||
member-total-balance
|
||||
|
||||
member-record-tests!
|
||||
)
|
||||
|
|
@ -357,19 +355,6 @@
|
|||
(define (member-payments mr)
|
||||
(dict-ref mr 'payments '()))
|
||||
|
||||
;; Balances totals
|
||||
(define (member-balance mr)
|
||||
(dict-ref mr 'balance (make-dict)))
|
||||
|
||||
;; Computes total member balance from credit, fees and payment
|
||||
;; information
|
||||
(define (member-total-balance mr)
|
||||
(let* ((bal (member-balance mr))
|
||||
(fees (dict-ref bal 'fees 0))
|
||||
(credit (dict-ref bal 'credit 0))
|
||||
(payment (dict-ref bal 'payment)))
|
||||
(- (+ credit payment) fees)))
|
||||
|
||||
;; Self-tests
|
||||
(define (member-record-tests!)
|
||||
(run-tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue