Adds the ability to change searching
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
[reagent.core :as reagent]
|
||||
[vimsical.re-frame.fx.track :as track]))
|
||||
|
||||
(def default-read [:numeric-code :name :location :type :account_set :applicability :invoice-allowance :id [:client-overrides [:name [:client [:name :id]]]]])
|
||||
(def default-read [:numeric-code :name :location :type :account_set :applicability :invoice-allowance :vendor-allowance :id [:client-overrides [:name [:client [:name :id]]]]])
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,11 +20,12 @@
|
||||
(re-frame/reg-sub
|
||||
::request
|
||||
:<- [::forms/form ::form]
|
||||
(fn [{{:keys [id location type client-overrides applicability invoice-allowance numeric-code name account-set]} :data}]
|
||||
(fn [{{:keys [id location type client-overrides applicability invoice-allowance vendor-allowance numeric-code name account-set]} :data}]
|
||||
{:id id
|
||||
:type (keyword type)
|
||||
:applicability (keyword applicability)
|
||||
:invoice-allowance (keyword invoice-allowance)
|
||||
:vendor-allowance (keyword vendor-allowance)
|
||||
:location (if (clojure.string/blank? location)
|
||||
nil
|
||||
location)
|
||||
@@ -44,7 +45,6 @@
|
||||
(re-frame/reg-event-db
|
||||
::editing
|
||||
(fn [db [_ which complete-listener]]
|
||||
(println "WHICH" which)
|
||||
(-> db
|
||||
(forms/start-form ::form which complete-listener))))
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
:operation/name "UpsertAccount"}
|
||||
:venia/queries [{:query/data [:upsert-account
|
||||
{:account request}
|
||||
[:id :type :name :account-set :numeric-code :location :applicability :invoice-allowance [:client-overrides [:name :id [:client [:id :name]]]]]]}]}
|
||||
[:id :type :name :account-set :numeric-code :location :applicability :invoice-allowance :vendor-allowance [:client-overrides [:name :id [:client [:id :name]]]]]]}]}
|
||||
:on-success [::edited]
|
||||
:on-error [::forms/save-error ::form]}})))
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
[:location {:optional true} [:maybe :string]]
|
||||
[:applicability [:enum :global :optional :customized]]
|
||||
[:invoice-allowance [:enum :allowed :denied :warn :admin-only]]
|
||||
[:vendor-allowance [:enum :allowed :denied :warn :admin-only]]
|
||||
[:client-overrides {:optional true}
|
||||
[:maybe [:sequential account-customization-schema]]]]))
|
||||
|
||||
@@ -131,6 +132,15 @@
|
||||
:allow-nil? true
|
||||
:keywordize? true}]]
|
||||
|
||||
[form-builder/field-v2 {:field :vendor-allowance}
|
||||
"Vendor Allowance"
|
||||
[com/select-field {:options (map (fn [l]
|
||||
[l
|
||||
(str/capitalize (name l))])
|
||||
allowances)
|
||||
:allow-nil? true
|
||||
:keywordize? true}]]
|
||||
|
||||
[form-builder/section {:title "Client"}
|
||||
[:h2.subtitle "Client"]
|
||||
[form-builder/field-v2 {:field :applicability}
|
||||
|
||||
Reference in New Issue
Block a user