You can add a vendor from the transactions page

This commit is contained in:
Bryce Covert
2019-05-04 07:30:00 -07:00
parent 36f5321454
commit 262f0072bc
5 changed files with 20 additions and 20 deletions

View File

@@ -102,7 +102,7 @@
(println (:auto-ap.forms/forms db))
(-> db
(update-in [:modal-state id] #(merge % state))
(dissoc :auto-ap.forms/forms)
#_(dissoc :auto-ap.forms/forms)
)))
(re-frame/reg-event-db
@@ -118,7 +118,7 @@
(println (:auto-ap.forms/forms db))
(-> db
(update-in [:modal-state] #(dissoc % id))
(dissoc :auto-ap.forms/forms))))
(update :auto-ap.forms/forms dissoc id))))
(re-frame/reg-event-fx
::set-active-page

View File

@@ -47,6 +47,6 @@
[:div
rest]
[:div {:class "compose has-text-centered"}
[:a {:class "button is-danger is-block is-bold" #_#_:href (bidi/path-for routes/routes :index)
[:a {:class "button is-primary is-outlined is-block is-bold"
:on-click (dispatch-event [::events/modal-status :auto-ap.views.main/user-editing-vendor {:visible? true}])}
[:span {:class "compose"} "New Vendor"]]]]))
[:span "New Vendor"]]]]))

View File

@@ -6,6 +6,7 @@
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
[auto-ap.views.components.layouts :refer [appearing-side-bar side-bar-layout]]
[auto-ap.views.components.modal :refer [action-modal]]
[auto-ap.views.components.vendor-dialog :refer [vendor-dialog]]
[auto-ap.views.components.paginator :refer [paginator]]
[auto-ap.views.components.sorter :refer [sorted-column]]
[auto-ap.views.pages.transactions.form :as edit]
@@ -105,7 +106,7 @@
[:div
[:h1.title "Transactions"]
(when (= "admin" (:user/role user))
(list
[:div
(when (:message @notification)
(list
[:div.notification
@@ -119,11 +120,8 @@
[:li (:description-original transaction) "-" (:details error)])]])))
[:div.is-pulled-right
[:div.buttons
(comment
[:button.button.is-danger {:on-click (dispatch-event [::manual/opening])}
"Manage Rules"])
[:button.button.is-danger {:on-click (dispatch-event [::manual/opening])}
"Manual Yodlee Import"]]]))
"Manual Yodlee Import"]]]])
[table/table {:id :transactions
:params (re-frame/subscribe [::params])
:transaction-page (re-frame/subscribe [::transaction-page])
@@ -147,8 +145,17 @@
[:div
[date-range-filter
{:on-change-event [::change-selected-date-range]
:value (:date-range-filter @(re-frame/subscribe [::transaction-page]))}]]]
:value (:date-range-filter @(re-frame/subscribe [::transaction-page]))}]]
[:div {:class " compose"}
[:a {:class "button is-primary is-outlined is-block "
:on-click (dispatch-event [::events/modal-status :auto-ap.views.main/user-editing-vendor {:visible? true}])}
[:span "New Vendor"]]]]
:main [transactions-content]
:bottom [:div [vendor-dialog {:vendor @(re-frame/subscribe [::subs/user-editing-vendor])
:save-event [::events/save-vendor]
:change-event [::events/change-nested-form-state [:user-editing-vendor]] :id :auto-ap.views.main/user-editing-vendor}]]
:right-side-bar [appearing-side-bar
{:visible? transaction-bar-active?}
[edit/form {:edit-completed [::edit-completed]}]]}]))

View File

@@ -635,8 +635,8 @@
(when (= 1 (count (set (map (comp :id :vendor) (vals checked-invoices)))))
^{:key "handwritten"} [:a.dropdown-item {:on-click (dispatch-event [::handwrite-checks])} "Handwritten Check..."])
^{:key "advanced"} [:a.dropdown-item {:on-click (dispatch-event [::advanced-print-checks])} "Advanced..."])]])]]
[:div.is-pulled-right
(into [:div.tags {:style {:margin-right ".5 rem;"}}] (map (fn [[id invoice]] [:span.tag.is-medium (:invoice-number invoice) [:button.delete.is-small {:on-click (dispatch-event [::toggle-check id invoice])}]]) checked-invoices))]]
[:div.is-pulled-right {:style {:margin-right "0.5rem"}}
(into [:div.tags ] (map (fn [[id invoice]] [:span.tag.is-medium (:invoice-number invoice) [:button.delete.is-small {:on-click (dispatch-event [::toggle-check id invoice])}]]) checked-invoices))]]
))
(defn check-results-dialog []