adds support for bulk voids.
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
states :states
|
||||
}]
|
||||
(let [{:keys [client s3-url bank-account payments type check-number date amount id vendor status invoices transaction] :as check} check]
|
||||
[grid/row {:class (:class check) :id id}
|
||||
[grid/row {:class (:class check) :id id :entity check}
|
||||
(when-not selected-client
|
||||
[grid/cell {} (:name client)])
|
||||
[grid/cell {} (:name vendor)]
|
||||
@@ -95,24 +95,25 @@
|
||||
(url/map->query {:exact-match-id (:id transaction)}))}]]])]]]]])
|
||||
[:span {:style {:margin-left "1em"}}]
|
||||
|
||||
(when (or (= :pending status)
|
||||
(and (#{":cash" :cash ":debit" :debit} type)
|
||||
(not= :voided status)
|
||||
(not transaction)))
|
||||
(when (and (not= :cleared status)
|
||||
(not= :voided status)
|
||||
(not transaction))
|
||||
|
||||
[buttons/sl-icon {:event [::void-check check] :icon :icon-bin-2
|
||||
:class (status/class-for (get states (:id check)))}]
|
||||
)]]]))
|
||||
:class (status/class-for (get states (:id check)))}])]]]))
|
||||
|
||||
(defn table [{:keys [data-page]}]
|
||||
(let [selected-client @(re-frame/subscribe [::subs/client])
|
||||
{:keys [data status]} @(re-frame/subscribe [::data-page/page data-page])
|
||||
{:keys [data params]} @(re-frame/subscribe [::data-page/page data-page])
|
||||
states @(re-frame/subscribe [::status/multi ::void])]
|
||||
[grid/grid {:data-page data-page
|
||||
:check-boxes? true
|
||||
:column-count (if selected-client 7 8)}
|
||||
[grid/controls data]
|
||||
[grid/table {:fullwidth true}
|
||||
[grid/header {}
|
||||
[grid/row {}
|
||||
[grid/row {:id "header"
|
||||
:entity params}
|
||||
(when-not selected-client
|
||||
[grid/sortable-header-cell {:sort-key "client" :sort-name "Client"} "Client"])
|
||||
[grid/sortable-header-cell {:sort-key "vendor" :sort-name "Vendor"} "Vendor"]
|
||||
|
||||
Reference in New Issue
Block a user