From 3a37e48436a5b5871e18a7aee044fc2d9bf8f937 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Tue, 26 Jul 2022 11:14:23 -0700 Subject: [PATCH] fix for display issue. --- .../auto_ap/views/pages/invoices/form.cljs | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/cljs/auto_ap/views/pages/invoices/form.cljs b/src/cljs/auto_ap/views/pages/invoices/form.cljs index 15862168..36598d82 100644 --- a/src/cljs/auto_ap/views/pages/invoices/form.cljs +++ b/src/cljs/auto_ap/views/pages/invoices/form.cljs @@ -16,12 +16,8 @@ [auto-ap.views.components.layouts :as layouts] [auto-ap.views.components.level :refer [left-stack]] [auto-ap.views.components.modal :as modal] - [auto-ap.views.components.money-field :refer [money-field]] - [auto-ap.views.components.typeahead :refer [typeahead-v3]] - [auto-ap.views.components.typeahead.vendor - :refer [search-backed-typeahead]] [auto-ap.views.pages.invoices.common :refer [invoice-read]] - [auto-ap.views.utils :refer [date-picker dispatch-event with-user]] + [auto-ap.views.utils :refer [date-picker dispatch-event with-user date->str]] [cljs-time.core :as c] [clojure.string :as str] [malli.core :as m] @@ -235,6 +231,7 @@ ::saving [with-user (forms/in-form ::form) (re-frame/inject-cofx ::inject/sub [::edit-query]) (re-frame/inject-cofx ::inject/sub [::create-query])] (fn [{:keys [user] {:keys [data]} :db ::keys [edit-query create-query]} _] + (println "DATA IS" data) {:graphql {:token user :owns-state {:single ::form} @@ -261,7 +258,7 @@ {:dispatch [::modal/modal-requested {:title "Scheduled payment date" :body [:div "This vendor isn't set up to be automatically paid. On " - (:scheduled-payment (:data db)) + (date->str (:scheduled-payment (:data db))) " the invoice will be marked as paid, but no payment will be made to the vendor. " "Are you sure you want to continue?"] :confirm {:value "Save" @@ -355,15 +352,15 @@ [form-builder/field-v2 {:required? true :field [:client]} "Client" - [typeahead-v3 {:entities @(re-frame/subscribe [::subs/clients]) - :entity->text :name - :style {:width "18em"} - :auto-focus (if active-client false true) - :disabled exists?}]]) + [com/entity-typeahead {:entities @(re-frame/subscribe [::subs/clients]) + :entity->text :name + :style {:width "18em"} + :auto-focus (if active-client false true) + :disabled exists?}]]) [form-builder/field-v2 {:required? true :field [:vendor]} "Vendor" - [search-backed-typeahead {:disabled exists? + [com/search-backed-typeahead {:disabled exists? :search-query (fn [i] [:search_vendor {:query i} @@ -398,7 +395,7 @@ [form-builder/field-v2 {:required? true :field :total} "Total" - [money-field {:disabled (if can-change-amount? "" "disabled") + [com/money-input {:disabled (if can-change-amount? "" "disabled") :style {:max-width "8em"} :min min-total}]]] [form-builder/field-v2 {:field :expense-accounts}