Use current month for filtering payments in member-record.
This commit is contained in:
parent
ba62b905fd
commit
f62fe1a08c
3 changed files with 12 additions and 14 deletions
|
@ -135,7 +135,8 @@ primes.import.scm: $(PRIMES-SOURCES)
|
||||||
|
|
||||||
MEMBER-RECORD-SOURCES=member-record.scm dictionary.import.scm \
|
MEMBER-RECORD-SOURCES=member-record.scm dictionary.import.scm \
|
||||||
period.import.scm testing.import.scm month.import.scm \
|
period.import.scm testing.import.scm month.import.scm \
|
||||||
configuration.import.scm primes.import.scm utils.import.scm
|
configuration.import.scm primes.import.scm utils.import.scm \
|
||||||
|
bank-account.import.scm
|
||||||
|
|
||||||
member-record.o: member-record.import.scm
|
member-record.o: member-record.import.scm
|
||||||
member-record.import.scm: $(MEMBER-RECORD-SOURCES)
|
member-record.import.scm: $(MEMBER-RECORD-SOURCES)
|
||||||
|
@ -212,8 +213,7 @@ bank-fio.import.scm: $(BANK-FIO-SOURCES)
|
||||||
|
|
||||||
MEMBERS-PAYMENTS-SOURCES=members-payments.scm bank-account.import.scm \
|
MEMBERS-PAYMENTS-SOURCES=members-payments.scm bank-account.import.scm \
|
||||||
dictionary.import.scm member-fees.import.scm \
|
dictionary.import.scm member-fees.import.scm \
|
||||||
period.import.scm configuration.import.scm utils.import.scm \
|
period.import.scm configuration.import.scm
|
||||||
month.import.scm
|
|
||||||
|
|
||||||
members-payments.o: members-payments.import.scm
|
members-payments.o: members-payments.import.scm
|
||||||
members-payments.import.scm: $(MEMBERS-PAYMENTS-SOURCES)
|
members-payments.import.scm: $(MEMBERS-PAYMENTS-SOURCES)
|
||||||
|
|
|
@ -83,7 +83,8 @@
|
||||||
period
|
period
|
||||||
configuration
|
configuration
|
||||||
primes
|
primes
|
||||||
utils)
|
utils
|
||||||
|
bank-account)
|
||||||
|
|
||||||
;; Checks whether given string is a 4-digit decimal number.
|
;; Checks whether given string is a 4-digit decimal number.
|
||||||
(define (is-4digit-string? s)
|
(define (is-4digit-string? s)
|
||||||
|
@ -353,7 +354,11 @@
|
||||||
|
|
||||||
;; Returns alist of member payments
|
;; Returns alist of member payments
|
||||||
(define (member-payments mr)
|
(define (member-payments mr)
|
||||||
(dict-ref mr 'payments '()))
|
(filter (lambda (tr)
|
||||||
|
(let* ((isodate (bank-transaction-date tr))
|
||||||
|
(month (iso-date->month isodate)))
|
||||||
|
(month<=? month (*current-month*))))
|
||||||
|
(dict-ref mr 'payments '())))
|
||||||
|
|
||||||
;; Self-tests
|
;; Self-tests
|
||||||
(define (member-record-tests!)
|
(define (member-record-tests!)
|
||||||
|
|
|
@ -49,9 +49,7 @@
|
||||||
dictionary
|
dictionary
|
||||||
member-fees
|
member-fees
|
||||||
period
|
period
|
||||||
configuration
|
configuration)
|
||||||
utils
|
|
||||||
month)
|
|
||||||
|
|
||||||
;; Exchange rates
|
;; Exchange rates
|
||||||
(define exchange-rates-lookup-table
|
(define exchange-rates-lookup-table
|
||||||
|
@ -162,12 +160,7 @@
|
||||||
((CZK) amount)
|
((CZK) amount)
|
||||||
((EUR) (* amount (lookup-eur-rate)))
|
((EUR) (* amount (lookup-eur-rate)))
|
||||||
(else 0))))
|
(else 0))))
|
||||||
(filter
|
(member-payments mr))))
|
||||||
(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