Adds vendor full name to dialog.
This commit is contained in:
@@ -181,6 +181,7 @@
|
||||
:default_account {:type :account}
|
||||
:invoice_reminder_schedule {:type 'String}
|
||||
|
||||
:legal_entity_name {:type 'String}
|
||||
:legal_entity_first_name {:type 'String}
|
||||
:legal_entity_middle_name {:type 'String}
|
||||
:legal_entity_last_name {:type 'String}
|
||||
@@ -468,6 +469,7 @@
|
||||
:account_overrides {:type '(list :add_account_override)}
|
||||
:schedule_payment_dom {:type '(list :add_schedule_payment_dom)}
|
||||
:invoice_reminder_schedule {:type 'String}
|
||||
:legal_entity_name {:type 'String}
|
||||
:legal_entity_first_name {:type 'String}
|
||||
:legal_entity_middle_name {:type 'String}
|
||||
:legal_entity_last_name {:type 'String}
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
:email (:email secondary_contact)})
|
||||
)}
|
||||
(is-admin? (:id context)) (assoc
|
||||
:vendor/legal-entity-name (:legal_entity_name in)
|
||||
:vendor/legal-entity-first-name (:legal_entity_first_name in)
|
||||
:vendor/legal-entity-middle-name (:legal_entity_middle_name in)
|
||||
:vendor/legal-entity-last-name (:legal_entity_last_name in)
|
||||
@@ -139,10 +140,9 @@
|
||||
_ (log/info "Upserting vendor" transaction)
|
||||
transaction-result (audit-transact transaction (:id context))]
|
||||
|
||||
(doto (-> (d-vendors/get-by-id (or (-> transaction-result :tempids (get "vendor"))
|
||||
id))
|
||||
(->graphql))
|
||||
log/info)))
|
||||
(-> (d-vendors/get-by-id (or (-> transaction-result :tempids (get "vendor"))
|
||||
id))
|
||||
(->graphql))))
|
||||
|
||||
(defn merge-vendors [context {:keys [from to]} _]
|
||||
(let [transaction (->> (d/query {:query {:find '[?x ?a2]
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
[:default-account schema/reference]
|
||||
[:account-overrides {:optional true}
|
||||
[:sequential account-override-schema]]
|
||||
[:legal-entity-name {:optional true}
|
||||
[:maybe :string]]
|
||||
[:legal-entity-first-name {:optional true}
|
||||
[:maybe :string]]
|
||||
[:legal-entity-middle-name {:optional true}
|
||||
@@ -76,7 +78,7 @@
|
||||
(re-frame/reg-event-fx
|
||||
::save
|
||||
[with-user with-is-admin? (forms/triggers-loading ::vendor-form) (forms/in-form ::vendor-form)]
|
||||
(fn [{:keys [user is-admin?] {{:keys [name hidden print-as terms invoice-reminder-schedule primary-contact automatically-paid-when-due schedule-payment-dom secondary-contact address default-account terms-overrides account-overrides id legal-entity-tin legal-entity-tin-type legal-entity-first-name legal-entity-last-name legal-entity-middle-name legal-entity-1099-type] :as data} :data} :db} _]
|
||||
(fn [{:keys [user is-admin?] {{:keys [name hidden print-as terms invoice-reminder-schedule primary-contact automatically-paid-when-due schedule-payment-dom secondary-contact address default-account terms-overrides account-overrides id legal-entity-name legal-entity-tin legal-entity-tin-type legal-entity-first-name legal-entity-last-name legal-entity-middle-name legal-entity-1099-type] :as data} :data} :db} _]
|
||||
(if (m/validate schema data)
|
||||
(let [query [:upsert-vendor
|
||||
{:vendor (cond-> {:id id
|
||||
@@ -112,6 +114,7 @@
|
||||
:automatically-paid-when-due (mapv
|
||||
(comp :id :client)
|
||||
automatically-paid-when-due)
|
||||
:legal-entity-name legal-entity-name
|
||||
:legal-entity-first-name legal-entity-first-name
|
||||
:legal-entity-middle-name legal-entity-middle-name
|
||||
:legal-entity-last-name legal-entity-last-name
|
||||
@@ -275,6 +278,13 @@
|
||||
|
||||
(when is-admin?
|
||||
[form-builder/section {:title "Legal Entity"}
|
||||
[form-builder/field-v2 {:field :legal-entity-name}
|
||||
"Legal Entity Name"
|
||||
[:input.input {:type "text"
|
||||
:placeholder "Good Vendor LLC"}]]
|
||||
[:div
|
||||
"- OR -"]
|
||||
|
||||
[form-builder/vertical-control
|
||||
"Name"
|
||||
[left-stack
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
[:primary-contact [:name :phone :email :id]]
|
||||
[:secondary-contact [:id :name :phone :email]]
|
||||
:print-as :invoice-reminder-schedule :code
|
||||
:legal-entity-name
|
||||
:legal-entity-first-name :legal-entity-middle-name :legal-entity-last-name
|
||||
:legal-entity-tin :legal-entity-tin-type
|
||||
:legal-entity-1099-type
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
[:primary-contact [:name :phone :email :id]]
|
||||
[:secondary-contact [:id :name :phone :email]]
|
||||
:print-as :invoice-reminder-schedule :code
|
||||
:legal-entity-name
|
||||
:legal-entity-first-name :legal-entity-middle-name :legal-entity-last-name
|
||||
:legal-entity-tin :legal-entity-tin-type
|
||||
:legal-entity-1099-type
|
||||
|
||||
Reference in New Issue
Block a user