improve some things
This commit is contained in:
parent
60304168d7
commit
47016be103
|
@ -368,6 +368,10 @@
|
||||||
#_(sh "cp" beancount-file "/home/anish/usr/finance/")
|
#_(sh "cp" beancount-file "/home/anish/usr/finance/")
|
||||||
(sh "scp" "documents/ledger.beancount" "mossnet.lan:~/usr/finance/ledger.beancount"))
|
(sh "scp" "documents/ledger.beancount" "mossnet.lan:~/usr/finance/ledger.beancount"))
|
||||||
|
|
||||||
|
(defn backup-beancount-file
|
||||||
|
[]
|
||||||
|
(sh "cp" beancount-file "./documents/backup.beancount"))
|
||||||
|
|
||||||
(defn assert-balance
|
(defn assert-balance
|
||||||
[transaction checking?]
|
[transaction checking?]
|
||||||
(let [b (balance transaction)
|
(let [b (balance transaction)
|
||||||
|
@ -383,8 +387,8 @@
|
||||||
[csv checking? & _args]
|
[csv checking? & _args]
|
||||||
(read-accounts beancount-file)
|
(read-accounts beancount-file)
|
||||||
(if checking?
|
(if checking?
|
||||||
(mapv write-transaction-to-file (drop-last (take-csv csv)))
|
(mapv write-transaction-to-file (take-csv csv))
|
||||||
(mapv write-transaction-to-file-savings (drop-last (take-csv csv))))
|
(mapv write-transaction-to-file-savings (take-csv csv)))
|
||||||
(write-accounts beancount-file)
|
(write-accounts beancount-file)
|
||||||
(assert-balance (first (take-csv csv)) checking?)
|
(assert-balance (first (take-csv csv)) checking?)
|
||||||
(reset! new-accounts #{}))
|
(reset! new-accounts #{}))
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
(defn -main
|
(defn -main
|
||||||
[& _args]
|
[& _args]
|
||||||
|
(import/backup-beancount-file)
|
||||||
(download/download-csv)
|
(download/download-csv)
|
||||||
(download/move-download)
|
(download/move-download)
|
||||||
(import/main "./documents/checking.csv" true)
|
(import/main "./documents/checking.csv" true)
|
||||||
|
|
Loading…
Reference in a new issue