all functions work
This commit is contained in:
@@ -157,23 +157,19 @@
|
|||||||
(re-frame/reg-event-db
|
(re-frame/reg-event-db
|
||||||
::advanced-print-checks
|
::advanced-print-checks
|
||||||
(fn [db _]
|
(fn [db _]
|
||||||
(let [{:keys [checked invoices]} (get-in db [::invoice-page])]
|
(let [invoices @(re-frame/subscribe [::checked-invoices])]
|
||||||
(-> db
|
(-> db
|
||||||
(forms/stop-form ::form/form)
|
(forms/stop-form ::form/form)
|
||||||
(update-in [::invoice-page :print-checks-shown?] #(not %) )
|
(update-in [::invoice-page :print-checks-shown?] #(not %) )
|
||||||
(assoc-in [::advanced-print-checks] {:shown? true
|
(assoc-in [::advanced-print-checks] {:shown? true
|
||||||
:bank-account-id (:id (first @(re-frame/subscribe [::subs/bank-accounts])))
|
:bank-account-id (:id (first @(re-frame/subscribe [::subs/bank-accounts])))
|
||||||
:invoices (->> checked
|
:invoices (map #(assoc % :amount (:outstanding-balance %)) invoices )} )))))
|
||||||
vals
|
|
||||||
(map #(assoc % :amount (:outstanding-balance %))))} )))))
|
|
||||||
|
|
||||||
(re-frame/reg-event-fx
|
(re-frame/reg-event-fx
|
||||||
::handwrite-checks
|
::handwrite-checks
|
||||||
(fn [{:keys [db]} _]
|
(fn [{:keys [db]} _]
|
||||||
(let [{:keys [checked invoices]} (get-in db [::invoice-page])
|
(let [invoices @(re-frame/subscribe [::checked-invoices])
|
||||||
invoices (->> checked
|
invoices (map #(assoc % :amount (:outstanding-balance %)) invoices)]
|
||||||
vals
|
|
||||||
(map #(assoc % :amount (:outstanding-balance %))))]
|
|
||||||
|
|
||||||
{:dispatch [::events/modal-status ::handwrite-checks {:visible? true}]
|
{:dispatch [::events/modal-status ::handwrite-checks {:visible? true}]
|
||||||
:db (-> db
|
:db (-> db
|
||||||
|
|||||||
Reference in New Issue
Block a user