From 12d9acba59f02cf77e7d44d1593781703a971d6b Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Tue, 14 Mar 2023 20:42:09 -0700 Subject: [PATCH] fixes for kyle, ben, and cashflows. --- src/clj/auto_ap/graphql/accounts.clj | 1 + src/clj/auto_ap/graphql/checks.clj | 2 +- src/cljc/auto_ap/ledger/reports.cljc | 11 ++++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/clj/auto_ap/graphql/accounts.clj b/src/clj/auto_ap/graphql/accounts.clj index 21bf8420..a4af1c93 100644 --- a/src/clj/auto_ap/graphql/accounts.clj +++ b/src/clj/auto_ap/graphql/accounts.clj @@ -55,6 +55,7 @@ :account/invoice-allowance (some-> invoice-allowance (enum->keyword "allowance")) :account/vendor-allowance (some-> vendor-allowance (enum->keyword "allowance")) + :account/default-allowance :allowance/allowed :account/account-set account-set :account/location location :account/numeric-code (when-not id diff --git a/src/clj/auto_ap/graphql/checks.clj b/src/clj/auto_ap/graphql/checks.clj index c430e9dc..e22ce198 100644 --- a/src/clj/auto_ap/graphql/checks.clj +++ b/src/clj/auto_ap/graphql/checks.clj @@ -454,7 +454,7 @@ :bank-account-id (:db/id (:transaction/bank-account transaction)) :amount (- (:transaction/amount transaction)) :status :payment-status/pending - :date-range {:start (time/plus (:transaction/date transaction) (time/days 1))}})] + :date-range {:start (time/plus (:transaction/date transaction) (time/days -90))}})] (map ->graphql (reverse (sort-by :payment/date payments))))) (defn add-handwritten-check [context args _] diff --git a/src/cljc/auto_ap/ledger/reports.cljc b/src/cljc/auto_ap/ledger/reports.cljc index 02e3c69a..5d82e761 100644 --- a/src/cljc/auto_ap/ledger/reports.cljc +++ b/src/cljc/auto_ap/ledger/reports.cljc @@ -121,9 +121,14 @@ (<= start account-code end))) first last)] - (if (= operation :add) - amount - (- amount)))) + (cond (= operation :add) + amount + + (= operation :subtract) + (- amount) + + :else + amount))) (defn min-numeric-code [category] (->> (groupings category)