Adding vendor import stuff.
This commit is contained in:
@@ -34,6 +34,16 @@
|
||||
(assoc ::invoice-page (first (:invoice-page data)))
|
||||
(assoc-in [:status :loading] false))))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::toggle-check
|
||||
(fn [db [_ data]]
|
||||
(update-in db [::invoice-page :checked] (fn [x]
|
||||
|
||||
(let [x (or x #{})]
|
||||
(if (x data)
|
||||
(disj x data)
|
||||
(conj x data)))))))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::invalidated
|
||||
(fn [cofx [_ params]]
|
||||
@@ -44,10 +54,16 @@
|
||||
(fn []
|
||||
[:div
|
||||
[:h1.title "Unpaid invoices"]
|
||||
[:div.is-pulled-right
|
||||
[:button.button.is-primary "Print check(s)"]]
|
||||
|
||||
[invoice-table {:id :unpaid
|
||||
:params (re-frame/subscribe [::params])
|
||||
:invoice-page (re-frame/subscribe [::invoice-page])
|
||||
:status (re-frame/subscribe [::subs/status])
|
||||
:on-params-change (fn [params]
|
||||
(re-frame/dispatch [::params-change params])) }]])
|
||||
(re-frame/dispatch [::params-change params]))
|
||||
:check-boxes true
|
||||
:on-check-changed (fn [which]
|
||||
(re-frame/dispatch [::toggle-check which]))}]])
|
||||
{:component-will-mount #(re-frame/dispatch-sync [::params-change {}]) }))
|
||||
|
||||
Reference in New Issue
Block a user