Split out member id extraction.
This commit is contained in:
parent
3c56578d65
commit
9435659140
1 changed files with 16 additions and 11 deletions
|
@ -45,15 +45,9 @@
|
|||
dictionary
|
||||
member-fees)
|
||||
|
||||
;; Merges bank account statement into members payment keys. The
|
||||
;; payment key will be a list of transactions.
|
||||
(define (members-payments-process-bank mb ba)
|
||||
(let loop ((mb mb)
|
||||
(transactions (bank-account-transactions ba)))
|
||||
(if (null? transactions)
|
||||
mb
|
||||
(let* ((transaction (car transactions))
|
||||
(varsym-id0
|
||||
;; Extract probable member-id from transaction
|
||||
(define (transaction-extract-member-id transaction)
|
||||
(let* ((varsym-id0
|
||||
(string->number
|
||||
(bank-transaction-varsym transaction)))
|
||||
(varsym-id
|
||||
|
@ -64,6 +58,17 @@
|
|||
(substring msg ci)
|
||||
msg)))
|
||||
(string->number vs)))))
|
||||
varsym-id))
|
||||
|
||||
;; Merges bank account statement into members payment keys. The
|
||||
;; payment key will be a list of transactions.
|
||||
(define (members-payments-process-bank mb ba)
|
||||
(let loop ((mb mb)
|
||||
(transactions (bank-account-transactions ba)))
|
||||
(if (null? transactions)
|
||||
mb
|
||||
(let* ((transaction (car transactions))
|
||||
(varsym-id (transaction-extract-member-id transaction)))
|
||||
(loop (members-base-update mb
|
||||
(lambda (mr)
|
||||
(eq? (member-id mr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue