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