Preliminary payments filtering in member-payments.
This commit is contained in:
parent
f3fef71026
commit
ba62b905fd
3 changed files with 20 additions and 10 deletions
|
@ -49,7 +49,9 @@
|
|||
dictionary
|
||||
member-fees
|
||||
period
|
||||
configuration)
|
||||
configuration
|
||||
utils
|
||||
month)
|
||||
|
||||
;; Exchange rates
|
||||
(define exchange-rates-lookup-table
|
||||
|
@ -152,14 +154,20 @@
|
|||
|
||||
;; Total amount paid - calculated from payments
|
||||
(define (member-payments-total mr)
|
||||
(foldl + 0 (map (lambda (tr)
|
||||
(let ((amount (bank-transaction-amount tr))
|
||||
(currency (bank-transaction-currency tr)))
|
||||
(case currency
|
||||
((CZK) amount)
|
||||
((EUR) (* amount (lookup-eur-rate)))
|
||||
(else 0))))
|
||||
(member-payments mr))))
|
||||
(foldl + 0
|
||||
(map (lambda (tr)
|
||||
(let ((amount (bank-transaction-amount tr))
|
||||
(currency (bank-transaction-currency tr)))
|
||||
(case currency
|
||||
((CZK) amount)
|
||||
((EUR) (* amount (lookup-eur-rate)))
|
||||
(else 0))))
|
||||
(filter
|
||||
(lambda (tr)
|
||||
(let* ((isodate (bank-transaction-date tr))
|
||||
(month (iso-date->month isodate)))
|
||||
(month<=? month (*current-month*))))
|
||||
(member-payments mr)))))
|
||||
|
||||
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue