Adding vendor import stuff.

This commit is contained in:
Bryce Covert
2018-05-10 17:32:22 -07:00
parent df3755d099
commit 798bfae78a
9 changed files with 173 additions and 32 deletions

View File

@@ -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 {}]) }))