Keep track of last displayed value.

This commit is contained in:
Dominik Pantůček 2023-03-30 21:15:00 +02:00
parent 08e305bd5b
commit ca1270d7ae
4 changed files with 34 additions and 17 deletions

View file

@ -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)))))
)