From d31d2297eff6a3e7d90bf022ce41658b94e049e3 Mon Sep 17 00:00:00 2001 From: Bryce Date: Mon, 8 Apr 2024 21:32:58 -0700 Subject: [PATCH] Fixes issues customers have run into with new experience. --- src/clj/auto_ap/plaid/core.clj | 17 +++++++++++++++++ src/clj/auto_ap/ssr/grid_page_helper.clj | 4 +++- src/clj/auto_ap/ssr/invoices.clj | 15 ++++++++------- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/clj/auto_ap/plaid/core.clj b/src/clj/auto_ap/plaid/core.clj index ebcb96f9..0cec8676 100644 --- a/src/clj/auto_ap/plaid/core.clj +++ b/src/clj/auto_ap/plaid/core.clj @@ -77,3 +77,20 @@ "options" {"account_ids" [account-id]}})}) :body)) +(comment + (require '[datomic.api :as dc]) + + (require '[auto-ap.datomic :refer [conn]]) + + (doto (dc/q '[:find (pull ?ba [{:bank-account/plaid-account [* {:plaid-item/_accounts [*]}]}]) + :in $ ?ba] + (dc/db conn) + [:bank-account/code "NGHW-CB5029"]) + clojure.pprint/pprint) + (require 'auto-ap.time-reader) + + (clojure.pprint/pprint + (get-transactions "access-production-c0e322fa-f33d-4806-bc42-5fc883fb1ba4" "VZ8Y1azZMdhoYo9MQABrfpgz4jm4kPtakyxN5" #clj-time/date-time "2024-03-15" #clj-time/date-time "2024-03-30")) + (clojure.pprint/pprint (get-accounts "access-production-c0e322fa-f33d-4806-bc42-5fc883fb1ba4")) + + ) \ No newline at end of file diff --git a/src/clj/auto_ap/ssr/grid_page_helper.clj b/src/clj/auto_ap/ssr/grid_page_helper.clj index 8aa1b87f..91104757 100644 --- a/src/clj/auto_ap/ssr/grid_page_helper.clj +++ b/src/clj/auto_ap/ssr/grid_page_helper.clj @@ -259,7 +259,9 @@ (table* grid-spec identity request)]) - (:title grid-spec))) + (if (string? (:title grid-spec)) + (:title grid-spec) + ((:title grid-spec) request)))) (wrap-trim-client-ids) (query-params/wrap-parse-query-params (or (:parse-query-params grid-spec) (default-parse-query-params grid-spec))) diff --git a/src/clj/auto_ap/ssr/invoices.clj b/src/clj/auto_ap/ssr/invoices.clj index dd0087cd..edd09cbd 100644 --- a/src/clj/auto_ap/ssr/invoices.clj +++ b/src/clj/auto_ap/ssr/invoices.clj @@ -322,7 +322,8 @@ {}) (vals))) all-credits-or-debits (or (every? #(<= % 0.0) vendor-totals) - (every? #(>= % 0.0) vendor-totals))] + (every? #(>= % 0.0) vendor-totals)) + total (reduce + 0.0 vendor-totals)] [:div {:hx-target "this" @@ -349,7 +350,9 @@ :class "relative"} (if (> (count (:ids params)) 0) - (str "Pay " (count (:ids params)) " invoices") + (format "Pay %d invoices ($%,.2f)" + (count (:ids params)) + (or total 0.0)) "Pay") (when (or (= 0 (count ids)) (> selected-client-count 1)) @@ -872,7 +875,8 @@ :body (mm/default-step-body {} [:div.flex.flex-col.space-y-2 - (for [ba (:bank-accounts linear-wizard)] + (for [ba (:bank-accounts linear-wizard) + :when (:bank-account/visible ba)] (bank-account-card ba can-handwrite? credit-only?))]) :footer nil @@ -1133,10 +1137,7 @@ (->> (dc/q '[:find ?i :in $ [?i ...] :where [?i :invoice/status :invoice-status/unpaid] - [?i :invoice/client ?c] - [(get-else $ ?c :client/locked-until #inst "2000-01-01") ?lu] - [?i :invoice/date ?d] - [(>= ?d ?lu)]] + [?i :invoice/client ?c] ] (dc/db conn) ids) (map first)))