From 5d1709184742484b896a69ceb13540a0e4111907 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Thu, 24 Mar 2022 08:19:09 -0700 Subject: [PATCH] bug fixes. --- src/clj/auto_ap/import/transactions.clj | 12 ++++++++---- src/cljs/auto_ap/views/pages/admin/clients/form.cljs | 11 +++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/clj/auto_ap/import/transactions.clj b/src/clj/auto_ap/import/transactions.clj index d888acfe..6fd5a849 100644 --- a/src/clj/auto_ap/import/transactions.clj +++ b/src/clj/auto_ap/import/transactions.clj @@ -184,13 +184,17 @@ :not-ready (and (:bank-account/start-date bank-account) - (not (t/after? (coerce/to-date-time (:transaction/date transaction)) - (-> bank-account :bank-account/start-date coerce/to-date-time)))) + (and (not (t/after? (coerce/to-date-time (:transaction/date transaction)) + (-> bank-account :bank-account/start-date coerce/to-date-time))) + (not (t/equal? (coerce/to-date-time (:transaction/date transaction)) + (-> bank-account :bank-account/start-date coerce/to-date-time))))) :not-ready (and (:client/locked-until (:client/_bank-accounts bank-account)) - (not (t/after? (coerce/to-date-time (:transaction/date transaction)) - (coerce/to-date-time (:client/locked-until (:client/_bank-accounts bank-account)))))) + (and (not (t/after? (coerce/to-date-time (:transaction/date transaction)) + (coerce/to-date-time (:client/locked-until (:client/_bank-accounts bank-account))))) + (not (t/equal? (coerce/to-date-time (:transaction/date transaction)) + (coerce/to-date-time (:client/locked-until (:client/_bank-accounts bank-account))))))) :not-ready :else diff --git a/src/cljs/auto_ap/views/pages/admin/clients/form.cljs b/src/cljs/auto_ap/views/pages/admin/clients/form.cljs index 819c5838..582d467c 100644 --- a/src/cljs/auto_ap/views/pages/admin/clients/form.cljs +++ b/src/cljs/auto_ap/views/pages/admin/clients/form.cljs @@ -109,7 +109,15 @@ :code (:code new-client-data) ;; TODO add validation can't change :email (:email new-client-data) - :locked-until (some-> new-client-data :locked-until #_(date->str standard)) + :locked-until (cond (not (:locked-until new-client-data)) + nil + + (instance? goog.date.Date (:locked-until new-client-data)) + (date->str (:locked-until new-client-data) standard) + + :else + (:locked-until new-client-data) + ) :locations (mapv :location (:locations new-client-data)) :matches (mapv :match (:matches new-client-data)) :location-matches (:location-matches new-client-data) @@ -130,7 +138,6 @@ :amount amount}) (:forecasted-transactions new-client-data)) :bank-accounts (map (fn [{:keys [number name check-number plaid-account intuit-bank-account include-in-reports type id code numeric-code start-date bank-name routing bank-code new? sort-order visible yodlee-account-id locations yodlee-account]}] - (println intuit-bank-account) {:number number :name name :check-number (when-not (str/blank? check-number)