advanced printing.
This commit is contained in:
7
notes.txt
Normal file
7
notes.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
1) Aligning checks
|
||||||
|
2) popup blocker -- disable
|
||||||
|
3) Splitting accounts
|
||||||
|
4) Permissions per location
|
||||||
|
5) List of payments
|
||||||
|
6) add payment
|
||||||
|
7) add invoice
|
||||||
@@ -21,6 +21,10 @@
|
|||||||
(fn [db]
|
(fn [db]
|
||||||
(-> db ::advanced-print-checks)))
|
(-> db ::advanced-print-checks)))
|
||||||
|
|
||||||
|
(re-frame/reg-sub
|
||||||
|
::check-results
|
||||||
|
(fn [db]
|
||||||
|
(-> db ::check-results)))
|
||||||
|
|
||||||
(re-frame/reg-sub
|
(re-frame/reg-sub
|
||||||
::params
|
::params
|
||||||
@@ -76,6 +80,11 @@
|
|||||||
(fn [db _]
|
(fn [db _]
|
||||||
(assoc-in db [::advanced-print-checks :shown?] false )))
|
(assoc-in db [::advanced-print-checks :shown?] false )))
|
||||||
|
|
||||||
|
(re-frame/reg-event-db
|
||||||
|
::close-check-results
|
||||||
|
(fn [db _]
|
||||||
|
(assoc-in db [::check-results :shown?] false )))
|
||||||
|
|
||||||
(re-frame/reg-event-db
|
(re-frame/reg-event-db
|
||||||
::edit-payment-bank-account
|
::edit-payment-bank-account
|
||||||
(fn [db [_ f v]]
|
(fn [db [_ f v]]
|
||||||
@@ -147,7 +156,7 @@
|
|||||||
(fn [{:keys [db]} [_ data]]
|
(fn [{:keys [db]} [_ data]]
|
||||||
(let [{{:keys [pdf-url invoices]} :print-checks} data
|
(let [{{:keys [pdf-url invoices]} :print-checks} data
|
||||||
invoices-by-id (by :id invoices) ]
|
invoices-by-id (by :id invoices) ]
|
||||||
{:new-window pdf-url
|
{
|
||||||
:db (-> db
|
:db (-> db
|
||||||
(update-in [::invoice-page :invoices]
|
(update-in [::invoice-page :invoices]
|
||||||
(fn [invoices]
|
(fn [invoices]
|
||||||
@@ -158,6 +167,8 @@
|
|||||||
(assoc-in [::invoice-page :print-checks-loading?] false)
|
(assoc-in [::invoice-page :print-checks-loading?] false)
|
||||||
(assoc-in [::advanced-print-checks :printing?] false)
|
(assoc-in [::advanced-print-checks :printing?] false)
|
||||||
(assoc-in [::advanced-print-checks :shown?] false)
|
(assoc-in [::advanced-print-checks :shown?] false)
|
||||||
|
(assoc-in [::check-results :shown?] true)
|
||||||
|
(assoc-in [::check-results :pdf-url] pdf-url)
|
||||||
)})))
|
)})))
|
||||||
|
|
||||||
(re-frame/reg-event-fx
|
(re-frame/reg-event-fx
|
||||||
@@ -217,7 +228,8 @@
|
|||||||
(with-meta
|
(with-meta
|
||||||
(fn []
|
(fn []
|
||||||
(let [{:keys [checked print-checks-shown? print-checks-loading? advanced-print-shown?]} @(re-frame/subscribe [::invoice-page])
|
(let [{:keys [checked print-checks-shown? print-checks-loading? advanced-print-shown?]} @(re-frame/subscribe [::invoice-page])
|
||||||
current-company @(re-frame/subscribe [::subs/company])]
|
current-company @(re-frame/subscribe [::subs/company])
|
||||||
|
{check-results-shown? :shown? pdf-url :pdf-url} @(re-frame/subscribe [::check-results])]
|
||||||
[:div
|
[:div
|
||||||
[:h1.title "Unpaid invoices"]
|
[:h1.title "Unpaid invoices"]
|
||||||
[:div.is-pulled-right
|
[:div.is-pulled-right
|
||||||
@@ -256,5 +268,10 @@
|
|||||||
(re-frame/dispatch [::toggle-check which]))}]
|
(re-frame/dispatch [::toggle-check which]))}]
|
||||||
|
|
||||||
[modal-dialog]
|
[modal-dialog]
|
||||||
|
(when check-results-shown?
|
||||||
|
[modal
|
||||||
|
{:title "Your checks are ready!"
|
||||||
|
:hide-event [::close-check-results]}
|
||||||
|
[:div "Click " [:a {:href pdf-url :target "_new"} "here"] " to print them."]])
|
||||||
]))
|
]))
|
||||||
{:component-will-mount #(re-frame/dispatch-sync [::params-change {}]) }))
|
{:component-will-mount #(re-frame/dispatch-sync [::params-change {}]) }))
|
||||||
|
|||||||
Reference in New Issue
Block a user