Tons of small fixes

This commit is contained in:
Bryce Covert
2020-07-27 21:28:02 -07:00
parent 3737cfa628
commit fdc1d3e9e4
26 changed files with 428 additions and 178 deletions

View File

@@ -186,6 +186,16 @@
(if (= which (:id i))
(assoc-in i f v)
i))))))
(re-frame/reg-event-db
::action-failed
[(re-frame/path [::invoice-page])]
(fn [db [_ result]]
(-> db
(assoc :action-notification (first (map :message result)))
(assoc :print-checks-loading? false))))
(re-frame/reg-event-db
::edit-handwritten-payment
(fn [db [_ which f v]]
@@ -224,7 +234,8 @@
bank-account-id
type
(:client db))
:on-success [::checks-created]}}))
:on-success [::checks-created]
:on-error [::action-failed]}}))
@@ -273,6 +284,7 @@
invoices)))
(assoc-in [::invoice-page :checked] nil)
(assoc-in [::invoice-page :print-checks-loading?] false)
(assoc-in [::invoice-page :action-notification] nil)
(assoc-in [::advanced-print-checks :printing?] false)
(assoc-in [::advanced-print-checks :shown?] false))
:dispatch [::checks-printed pdf-url]})))
@@ -614,10 +626,13 @@
]))))
(defn unpaid-invoices-content [{:keys [status] :as params}]
(let [{:keys [checked print-checks-shown? print-checks-loading? advanced-print-shown? vendor-filter]} @(re-frame/subscribe [::invoice-page])
(let [{:keys [checked action-notification print-checks-shown? print-checks-loading? advanced-print-shown? vendor-filter]} @(re-frame/subscribe [::invoice-page])
current-client @(re-frame/subscribe [::subs/client])]
[:div
#_[:h1.title (str (str/capitalize (or status "all")) " invoices")]
(when action-notification
[:div.notification
action-notification])
(when (= status :unpaid)
[pay-button {:print-checks-shown? print-checks-shown? :checked-invoices checked :print-checks-loading? print-checks-loading?}])
[table/invoice-table {:id :unpaid