Adds vendor full name to dialog.

This commit is contained in:
2023-02-23 22:02:59 -08:00
parent 590265f4a9
commit eb87367e8b
5 changed files with 19 additions and 5 deletions

View File

@@ -181,6 +181,7 @@
:default_account {:type :account} :default_account {:type :account}
:invoice_reminder_schedule {:type 'String} :invoice_reminder_schedule {:type 'String}
:legal_entity_name {:type 'String}
:legal_entity_first_name {:type 'String} :legal_entity_first_name {:type 'String}
:legal_entity_middle_name {:type 'String} :legal_entity_middle_name {:type 'String}
:legal_entity_last_name {:type 'String} :legal_entity_last_name {:type 'String}
@@ -468,6 +469,7 @@
:account_overrides {:type '(list :add_account_override)} :account_overrides {:type '(list :add_account_override)}
:schedule_payment_dom {:type '(list :add_schedule_payment_dom)} :schedule_payment_dom {:type '(list :add_schedule_payment_dom)}
:invoice_reminder_schedule {:type 'String} :invoice_reminder_schedule {:type 'String}
:legal_entity_name {:type 'String}
:legal_entity_first_name {:type 'String} :legal_entity_first_name {:type 'String}
:legal_entity_middle_name {:type 'String} :legal_entity_middle_name {:type 'String}
:legal_entity_last_name {:type 'String} :legal_entity_last_name {:type 'String}

View File

@@ -120,6 +120,7 @@
:email (:email secondary_contact)}) :email (:email secondary_contact)})
)} )}
(is-admin? (:id context)) (assoc (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-first-name (:legal_entity_first_name in)
:vendor/legal-entity-middle-name (:legal_entity_middle_name in) :vendor/legal-entity-middle-name (:legal_entity_middle_name in)
:vendor/legal-entity-last-name (:legal_entity_last_name in) :vendor/legal-entity-last-name (:legal_entity_last_name in)
@@ -139,10 +140,9 @@
_ (log/info "Upserting vendor" transaction) _ (log/info "Upserting vendor" transaction)
transaction-result (audit-transact transaction (:id context))] transaction-result (audit-transact transaction (:id context))]
(doto (-> (d-vendors/get-by-id (or (-> transaction-result :tempids (get "vendor")) (-> (d-vendors/get-by-id (or (-> transaction-result :tempids (get "vendor"))
id)) id))
(->graphql)) (->graphql))))
log/info)))
(defn merge-vendors [context {:keys [from to]} _] (defn merge-vendors [context {:keys [from to]} _]
(let [transaction (->> (d/query {:query {:find '[?x ?a2] (let [transaction (->> (d/query {:query {:find '[?x ?a2]

View File

@@ -52,6 +52,8 @@
[:default-account schema/reference] [:default-account schema/reference]
[:account-overrides {:optional true} [:account-overrides {:optional true}
[:sequential account-override-schema]] [:sequential account-override-schema]]
[:legal-entity-name {:optional true}
[:maybe :string]]
[:legal-entity-first-name {:optional true} [:legal-entity-first-name {:optional true}
[:maybe :string]] [:maybe :string]]
[:legal-entity-middle-name {:optional true} [:legal-entity-middle-name {:optional true}
@@ -76,7 +78,7 @@
(re-frame/reg-event-fx (re-frame/reg-event-fx
::save ::save
[with-user with-is-admin? (forms/triggers-loading ::vendor-form) (forms/in-form ::vendor-form)] [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) (if (m/validate schema data)
(let [query [:upsert-vendor (let [query [:upsert-vendor
{:vendor (cond-> {:id id {:vendor (cond-> {:id id
@@ -112,6 +114,7 @@
:automatically-paid-when-due (mapv :automatically-paid-when-due (mapv
(comp :id :client) (comp :id :client)
automatically-paid-when-due) automatically-paid-when-due)
:legal-entity-name legal-entity-name
:legal-entity-first-name legal-entity-first-name :legal-entity-first-name legal-entity-first-name
:legal-entity-middle-name legal-entity-middle-name :legal-entity-middle-name legal-entity-middle-name
:legal-entity-last-name legal-entity-last-name :legal-entity-last-name legal-entity-last-name
@@ -275,6 +278,13 @@
(when is-admin? (when is-admin?
[form-builder/section {:title "Legal Entity"} [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 [form-builder/vertical-control
"Name" "Name"
[left-stack [left-stack

View File

@@ -23,6 +23,7 @@
[:primary-contact [:name :phone :email :id]] [:primary-contact [:name :phone :email :id]]
[:secondary-contact [:id :name :phone :email]] [:secondary-contact [:id :name :phone :email]]
:print-as :invoice-reminder-schedule :code :print-as :invoice-reminder-schedule :code
:legal-entity-name
:legal-entity-first-name :legal-entity-middle-name :legal-entity-last-name :legal-entity-first-name :legal-entity-middle-name :legal-entity-last-name
:legal-entity-tin :legal-entity-tin-type :legal-entity-tin :legal-entity-tin-type
:legal-entity-1099-type :legal-entity-1099-type

View File

@@ -9,6 +9,7 @@
[:primary-contact [:name :phone :email :id]] [:primary-contact [:name :phone :email :id]]
[:secondary-contact [:id :name :phone :email]] [:secondary-contact [:id :name :phone :email]]
:print-as :invoice-reminder-schedule :code :print-as :invoice-reminder-schedule :code
:legal-entity-name
:legal-entity-first-name :legal-entity-middle-name :legal-entity-last-name :legal-entity-first-name :legal-entity-middle-name :legal-entity-last-name
:legal-entity-tin :legal-entity-tin-type :legal-entity-tin :legal-entity-tin-type
:legal-entity-1099-type :legal-entity-1099-type