Changed rollup logic to consider cash
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
:account-type/dividend
|
:account-type/dividend
|
||||||
:account-type/expense}
|
:account-type/expense}
|
||||||
(:db/ident (:account/type account)))
|
(:db/ident (:account/type account)))
|
||||||
(#{:bank-account-type/check}
|
(#{:bank-account-type/check :bank-account-type/cash}
|
||||||
(-> account :bank-account/type :db/ident ))))
|
(-> account :bank-account/type :db/ident ))))
|
||||||
|
|
||||||
(defn expense-account? [account]
|
(defn expense-account? [account]
|
||||||
@@ -96,10 +96,7 @@
|
|||||||
(let [account (lookup-account account-id)
|
(let [account (lookup-account account-id)
|
||||||
account-type (:account_type account)]
|
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
|
:amount (if account-type (if (#{:account-type/asset
|
||||||
:account-type/dividend
|
:account-type/dividend
|
||||||
:account-type/expense} account-type)
|
:account-type/expense} account-type)
|
||||||
@@ -141,10 +138,11 @@
|
|||||||
(:account/name (accounts a)))
|
(:account/name (accounts a)))
|
||||||
:account_type (or (:db/ident (:account/type (accounts a)))
|
:account_type (or (:db/ident (:account/type (accounts a)))
|
||||||
({:bank-account-type/check :account-type/asset
|
({:bank-account-type/check :account-type/asset
|
||||||
|
:bank-account-type/cash :account-type/asset
|
||||||
:bank-account-type/credit :account-type/liability}
|
:bank-account-type/credit :account-type/liability}
|
||||||
(:db/ident (:bank-account/type (bank-accounts a)))))
|
(:db/ident (:bank-account/type (bank-accounts a)))))
|
||||||
:numeric_code (or (:account/numeric-code (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)
|
11100)
|
||||||
(and (#{:bank-account-type/credit} (:db/ident (:bank-account/type (bank-accounts a))))
|
(and (#{:bank-account-type/credit} (:db/ident (:bank-account/type (bank-accounts a))))
|
||||||
28000))})))
|
28000))})))
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#'ledger/touch-broken-ledger-worker
|
#'ledger/touch-broken-ledger-worker
|
||||||
#'ledger/process-txes-worker
|
#'ledger/process-txes-worker
|
||||||
#'ledger/ledger-reconciliation-worker
|
#'ledger/ledger-reconciliation-worker
|
||||||
|
#'auto-ap.background.invoices/close-auto-invoices-worker
|
||||||
#'gq-clients/current-balance-worker
|
#'gq-clients/current-balance-worker
|
||||||
#'yodlee/import-transaction-worker
|
#'yodlee/import-transaction-worker
|
||||||
#'yodlee2/yodlee-sync-worker
|
#'yodlee2/yodlee-sync-worker
|
||||||
|
|||||||
@@ -314,7 +314,8 @@
|
|||||||
(try
|
(try
|
||||||
(upsert-accounts-tx (:client/code client))
|
(upsert-accounts-tx (:client/code client))
|
||||||
(catch Exception e
|
(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)))
|
(async/to-chan (d-clients/get-all)))
|
||||||
(let [result (async/<!! (async/into [] output-chan))]
|
(let [result (async/<!! (async/into [] output-chan))]
|
||||||
(log/info "Current yodlee state is " result)
|
(log/info "Current yodlee state is " result)
|
||||||
|
|||||||
Reference in New Issue
Block a user