Vendor sub not needed.
This commit is contained in:
@@ -119,6 +119,7 @@
|
||||
(let [{:keys [client status payments expense-accounts invoice-number date due total outstanding-balance id vendor source-url] :as i} invoice
|
||||
accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id client])
|
||||
unautopay-states @(re-frame/subscribe [::status/multi ::unautopay])
|
||||
editing-states @(re-frame/subscribe [::status/multi ::edits])
|
||||
account->name #(:name (accounts-by-id (:id %)))]
|
||||
[grid/row {:class (:class i) :id id :checkable? checkable? :entity invoice}
|
||||
(when-not selected-client
|
||||
@@ -213,7 +214,14 @@
|
||||
(when (and (get actions :edit)
|
||||
(not= ":voided" (:status i)))
|
||||
[buttons/fa-icon {:icon "fa-pencil"
|
||||
:event [::form/editing i]}])
|
||||
:class (status/class-for (get editing-states id))
|
||||
:event
|
||||
[::events/vendor-preferences-requested {:client-id (:id client)
|
||||
:vendor-id (:id vendor)
|
||||
:on-success [::form/editing i]
|
||||
:on-failure []
|
||||
:owns-state {:multi ::edits
|
||||
:which (:id i)}}]}])
|
||||
(when (and (get actions :void)
|
||||
(= (:outstanding-balance i) (:total i)) (not= ":voided" (:status i)))
|
||||
[buttons/sl-icon {:icon "icon-bin-2"
|
||||
|
||||
Reference in New Issue
Block a user