More ignored transactions.
This commit is contained in:
parent
073c1efbc6
commit
29d4c7986f
1 changed files with 9 additions and 4 deletions
|
@ -60,13 +60,17 @@
|
||||||
(make-period-lookup-table
|
(make-period-lookup-table
|
||||||
'(((2010 1) 25))))
|
'(((2010 1) 25))))
|
||||||
|
|
||||||
|
;; Transaction types to ignore
|
||||||
|
(define ignored-transaction-types
|
||||||
|
'("Poplatek" "Připsaný úrok"))
|
||||||
|
|
||||||
;; Lookup CZK/EUR
|
;; Lookup CZK/EUR
|
||||||
(define (lookup-eur-rate)
|
(define (lookup-eur-rate)
|
||||||
(car (lookup-by-period exchange-rates-lookup-table)))
|
(car (lookup-by-period exchange-rates-lookup-table)))
|
||||||
|
|
||||||
;; Extract probable member-id from transaction
|
;; Extract probable member-id from transaction
|
||||||
(define (transaction-extract-member-id transaction)
|
(define (transaction-extract-member-id transaction)
|
||||||
(if (equal? (bank-transaction-type transaction) "Poplatek")
|
(if (member (bank-transaction-type transaction) ignored-transaction-types)
|
||||||
#f
|
#f
|
||||||
(let* ((varsym-id0
|
(let* ((varsym-id0
|
||||||
(string->number
|
(string->number
|
||||||
|
@ -94,8 +98,8 @@
|
||||||
mb
|
mb
|
||||||
(let* ((transaction (car transactions))
|
(let* ((transaction (car transactions))
|
||||||
(varsym-id (transaction-extract-member-id transaction))
|
(varsym-id (transaction-extract-member-id transaction))
|
||||||
(member (find-member-by-id mb varsym-id)))
|
(bmember (find-member-by-id mb varsym-id)))
|
||||||
(loop (if member
|
(loop (if bmember
|
||||||
(members-base-update
|
(members-base-update
|
||||||
mb
|
mb
|
||||||
(lambda (mr)
|
(lambda (mr)
|
||||||
|
@ -108,7 +112,8 @@
|
||||||
(> (bank-transaction-amount transaction) 0)
|
(> (bank-transaction-amount transaction) 0)
|
||||||
(not (bank-accounts-member? all-accounts
|
(not (bank-accounts-member? all-accounts
|
||||||
(bank-transaction-account transaction)
|
(bank-transaction-account transaction)
|
||||||
(bank-transaction-bank transaction))))
|
(bank-transaction-bank transaction)))
|
||||||
|
(not (member (bank-transaction-type transaction) ignored-transaction-types)))
|
||||||
(members-base-add-unpaired mb transaction)
|
(members-base-add-unpaired mb transaction)
|
||||||
mb))
|
mb))
|
||||||
(cdr transactions))))))
|
(cdr transactions))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue