Keep track of last displayed value.
This commit is contained in:
parent
08e305bd5b
commit
ca1270d7ae
4 changed files with 34 additions and 17 deletions
25
bank-fio.scm
25
bank-fio.scm
|
@ -35,7 +35,8 @@
|
|||
(chicken base)
|
||||
(chicken irregex)
|
||||
bank-account
|
||||
csv-simple)
|
||||
csv-simple
|
||||
progress)
|
||||
|
||||
;; Converts Fio account statement transaction row into standardized
|
||||
;; bank transaction structure.
|
||||
|
@ -52,15 +53,17 @@
|
|||
|
||||
;; Loads Fio bank accound statement.
|
||||
(define (bank-fio-parse fn)
|
||||
(let* ((csv (csv-parse fn))
|
||||
(head+body (csv-split-header csv))
|
||||
(head (car head+body))
|
||||
(body (cadr head+body))
|
||||
(numrow (assoc "accountId" head))
|
||||
(num (if numrow (cadr numrow) "ERROR"))
|
||||
(bankrow (assoc "bankId" head))
|
||||
(bank (if bankrow (cadr bankrow) "ERROR")))
|
||||
(make-bank-account num bank
|
||||
(map make-fio-transaction body))))
|
||||
(with-progress%
|
||||
#t fn
|
||||
(let* ((csv (csv-parse fn))
|
||||
(head+body (csv-split-header csv))
|
||||
(head (car head+body))
|
||||
(body (cadr head+body))
|
||||
(numrow (assoc "accountId" head))
|
||||
(num (if numrow (cadr numrow) "ERROR"))
|
||||
(bankrow (assoc "bankId" head))
|
||||
(bank (if bankrow (cadr bankrow) "ERROR")))
|
||||
(make-bank-account num bank
|
||||
(map make-fio-transaction body)))))
|
||||
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue