added ability to schedule payment on DOM
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
[clojure.set :as set]))
|
||||
|
||||
|
||||
(defn upsert-vendor [context {{:keys [id name hidden terms code print_as primary_contact secondary_contact address default_account_id invoice_reminder_schedule terms_overrides account_overrides] :as in} :vendor} value]
|
||||
(defn upsert-vendor [context {{:keys [id name hidden terms code print_as primary_contact secondary_contact address default_account_id invoice_reminder_schedule schedule_payment_dom terms_overrides account_overrides] :as in} :vendor} value]
|
||||
(when id
|
||||
(assert-admin (:id context)))
|
||||
#_(Thread/sleep 3000)
|
||||
@@ -31,6 +31,13 @@
|
||||
:account (:account_id ao)}
|
||||
(:id ao) (assoc :db/id (:id ao))))
|
||||
account_overrides)
|
||||
schedule-payment-dom (mapv
|
||||
(fn [ao]
|
||||
(cond->
|
||||
#:vendor-schedule-payment-dom {:client (:client_id ao)
|
||||
:dom (:dom ao)}
|
||||
(:id ao) (assoc :db/id (:id ao))))
|
||||
schedule_payment_dom)
|
||||
transaction (cond->
|
||||
[(remove-nils #:vendor {:db/id (if id
|
||||
id
|
||||
@@ -73,6 +80,7 @@
|
||||
)})]
|
||||
(is-admin? (:id context)) (conj [:reset (if id id "vendor") :vendor/account-overrides account-overrides])
|
||||
(is-admin? (:id context)) (conj [:reset (if id id "vendor") :vendor/terms-overrides terms-overrides])
|
||||
(is-admin? (:id context)) (conj [:reset (if id id "vendor") :vendor/schedule-payment-dom schedule-payment-dom])
|
||||
(is-admin? (:id context)) (conj [:reset (if id id "vendor") :vendor/automatically-paid-when-due
|
||||
(mapv
|
||||
(fn [apwd]
|
||||
|
||||
Reference in New Issue
Block a user