Changed rollup logic to consider cash

This commit is contained in:
2021-04-27 20:41:08 -07:00
parent d20ef05eaa
commit ec236ae979
3 changed files with 7 additions and 7 deletions

View File

@@ -56,7 +56,7 @@
:account-type/dividend
:account-type/expense}
(:db/ident (:account/type account)))
(#{:bank-account-type/check}
(#{:bank-account-type/check :bank-account-type/cash}
(-> account :bank-account/type :db/ident ))))
(defn expense-account? [account]
@@ -96,10 +96,7 @@
(let [account (lookup-account account-id)
account-type (:account_type account)]
(conj acc (merge {:id (str account-id "-" location)
:location (or location "")
:count count
(conj acc (merge {:id (str account-id "-" location) :location (or location "") :count count
:amount (if account-type (if (#{:account-type/asset
:account-type/dividend
:account-type/expense} account-type)
@@ -141,10 +138,11 @@
(:account/name (accounts a)))
:account_type (or (:db/ident (:account/type (accounts a)))
({:bank-account-type/check :account-type/asset
:bank-account-type/cash :account-type/asset
:bank-account-type/credit :account-type/liability}
(:db/ident (:bank-account/type (bank-accounts a)))))
:numeric_code (or (:account/numeric-code (accounts a))
(and (#{:bank-account-type/check} (:db/ident (:bank-account/type (bank-accounts a))))
(and (#{:bank-account-type/check :bank-account-type/cash} (:db/ident (:bank-account/type (bank-accounts a))))
11100)
(and (#{:bank-account-type/credit} (:db/ident (:bank-account/type (bank-accounts a))))
28000))})))

View File

@@ -36,6 +36,7 @@
#'ledger/touch-broken-ledger-worker
#'ledger/process-txes-worker
#'ledger/ledger-reconciliation-worker
#'auto-ap.background.invoices/close-auto-invoices-worker
#'gq-clients/current-balance-worker
#'yodlee/import-transaction-worker
#'yodlee2/yodlee-sync-worker

View File

@@ -314,7 +314,8 @@
(try
(upsert-accounts-tx (:client/code client))
(catch Exception e
(log/error "Could not update client " (:client/code client)))))))
(log/error "Could not update client " (:client/code client)
e))))))
(async/to-chan (d-clients/get-all)))
(let [result (async/<!! (async/into [] output-chan))]
(log/info "Current yodlee state is " result)