From ec236ae97996d8bc9cb81b30c49d4284678d7612 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Tue, 27 Apr 2021 20:41:08 -0700 Subject: [PATCH] Changed rollup logic to consider cash --- src/clj/auto_ap/graphql/ledger.clj | 10 ++++------ src/clj/auto_ap/server.clj | 1 + src/clj/auto_ap/yodlee/core2.clj | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/clj/auto_ap/graphql/ledger.clj b/src/clj/auto_ap/graphql/ledger.clj index 23b665d3..95ac42c8 100644 --- a/src/clj/auto_ap/graphql/ledger.clj +++ b/src/clj/auto_ap/graphql/ledger.clj @@ -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))}))) diff --git a/src/clj/auto_ap/server.clj b/src/clj/auto_ap/server.clj index 6df24f17..c5aba7b2 100644 --- a/src/clj/auto_ap/server.clj +++ b/src/clj/auto_ap/server.clj @@ -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 diff --git a/src/clj/auto_ap/yodlee/core2.clj b/src/clj/auto_ap/yodlee/core2.clj index 1341f9e4..536be233 100644 --- a/src/clj/auto_ap/yodlee/core2.clj +++ b/src/clj/auto_ap/yodlee/core2.clj @@ -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/