Invoices can be renamed
This commit is contained in:
@@ -302,7 +302,7 @@
|
|||||||
:errors (fc/field-errors)}
|
:errors (fc/field-errors)}
|
||||||
[:div {:class "w-24"}
|
[:div {:class "w-24"}
|
||||||
(com/text-input {:value (-> (fc/field-value))
|
(com/text-input {:value (-> (fc/field-value))
|
||||||
:disabled (boolean (-> request :multi-form-state :snapshot :db/id))
|
#_#_:disabled (boolean (-> request :multi-form-state :snapshot :db/id))
|
||||||
:name (fc/field-name)
|
:name (fc/field-name)
|
||||||
:error? (fc/field-errors)
|
:error? (fc/field-errors)
|
||||||
:placeholder "HA-123"})]))
|
:placeholder "HA-123"})]))
|
||||||
@@ -584,10 +584,11 @@
|
|||||||
:validation-route ::route/new-wizard-navigate)))
|
:validation-route ::route/new-wizard-navigate)))
|
||||||
|
|
||||||
|
|
||||||
(defn assert-no-conflicting [{:invoice/keys [invoice-number client vendor]}]
|
(defn assert-no-conflicting [{:invoice/keys [invoice-number client vendor] :db/keys [id]}]
|
||||||
(when (seq (d-invoices/find-conflicting {:invoice/invoice-number invoice-number
|
(when (seq (d-invoices/find-conflicting {:invoice/invoice-number invoice-number
|
||||||
:invoice/vendor (->db-id vendor)
|
:invoice/vendor (->db-id vendor)
|
||||||
:invoice/client (->db-id client)}))
|
:invoice/client (->db-id client)
|
||||||
|
:db/id id}))
|
||||||
(form-validation-error (str "Invoice '" invoice-number "' already exists."))))
|
(form-validation-error (str "Invoice '" invoice-number "' already exists."))))
|
||||||
|
|
||||||
|
|
||||||
@@ -736,8 +737,7 @@
|
|||||||
(update :invoice/due coerce/to-date)
|
(update :invoice/due coerce/to-date)
|
||||||
(update :invoice/scheduled-payment coerce/to-date))]]
|
(update :invoice/scheduled-payment coerce/to-date))]]
|
||||||
(assert-invoice-amounts-add-up (second transaction))
|
(assert-invoice-amounts-add-up (second transaction))
|
||||||
(when-not extant?
|
(assert-no-conflicting invoice)
|
||||||
(assert-no-conflicting invoice))
|
|
||||||
(exception->4xx #(assert-can-see-client (:identity request) client-id))
|
(exception->4xx #(assert-can-see-client (:identity request) client-id))
|
||||||
|
|
||||||
(exception->4xx #(assert-not-locked client-id (:invoice/date invoice)))
|
(exception->4xx #(assert-not-locked client-id (:invoice/date invoice)))
|
||||||
|
|||||||
Reference in New Issue
Block a user