Makes reports exportable

This commit is contained in:
2023-09-23 07:48:06 -07:00
parent 12c676629d
commit be13bbbb4d
7 changed files with 15 additions and 19 deletions

View File

@@ -97,7 +97,7 @@ NOTE: Please review the transactions we may have question for you here: https://
:body [:div
[:div "Click "
[:a {:href (-> result :balance-sheet-pdf :url) :target "_new"} "here"] " to view it."]
(when (seq (:emails client))
(when (and (seq (:emails client)) @(re-frame/subscribe [::subs/is-admin?]))
[:div "Once you've confirmed you're happy with it, click "
[:a {:href (str "mailto:" (str/join ";" (map :email (:emails client))) "?body=" (email-body (-> result :balance-sheet-pdf :url))
"&subject=" (-> result :balance-sheet-pdf :name) " is ready")}
@@ -235,9 +235,7 @@ NOTE: Please review the transactions we may have question for you here: https://
[date-picker {:output :cljs-date}]])]]
[:div.level-right
[:div.buttons
(when @(re-frame/subscribe [::subs/is-admin?])
[:button.button.is-secondary {:on-click (dispatch-event [::export-pdf])} "Export"])
[:button.button.is-secondary {:on-click (dispatch-event [::export-pdf])} "Export"]
[:button.button.is-primary "Run"]]]]
[:div.report-control-detail {:ref (fn [el]
(when (not= @!box el)

View File

@@ -112,7 +112,7 @@ NOTE: Please review the transactions we may have question for you here: https://
:body [:div
[:div "Click "
[:a {:href (-> result :profit-and-loss-pdf :url) :target "_new"} "here"] " to view it."]
(when (and single-client? (seq client-emails))
(when (and single-client? (seq client-emails) @(re-frame/subscribe [::subs/is-admin?]))
[:div "Once you've confirmed you're happy with it, click "
[:a {:href (str "mailto:" (str/join ";" (map :email client-emails)) "?body=" (email-body (-> result :profit-and-loss-pdf :url))
"&subject=" (-> result :profit-and-loss-pdf :name) " is ready")}
@@ -402,8 +402,7 @@ NOTE: Please review the transactions we may have question for you here: https://
[:div.level-right
[:div.buttons
(when @(re-frame/subscribe [::subs/is-admin?])
[:button.button.is-secondary {:on-click (dispatch-event [::export-pdf])} "Export"])
[:button.button.is-secondary {:on-click (dispatch-event [::export-pdf])} "Export"]
[:button.button.is-primary "Run"]]
]]

View File

@@ -94,7 +94,7 @@ NOTE: Please review the transactions we may have question for you here: https://
:body [:div
[:div "Click "
[:a {:href (-> result :journal-detail-report-pdf :url) :target "_new"} "here"] " to view it."]
(when (and single-client? (seq client-emails))
(when (and single-client? (seq client-emails) @(re-frame/subscribe [::subs/is-admin?]))
[:div "Once you've confirmed you're happy with it, click "
[:a {:href (str "mailto:" (str/join ";" (map :email client-emails)) "?body=" (email-body (-> result :journal-detail-report-pdf :url))
"&subject=" (-> result :journal-detail-report-pdf :name) " is ready")}
@@ -181,8 +181,7 @@ NOTE: Please review the transactions we may have question for you here: https://
[date-picker {:output :cljs-date}]]]
[:div.level-right
[:div.buttons
(when @(re-frame/subscribe [::subs/is-admin?])
[:button.button.is-secondary {:on-click (dispatch-event [::export-pdf])} "Export"])
[:button.button.is-secondary {:on-click (dispatch-event [::export-pdf])} "Export"]
[:button.button.is-primary "Run"]]]]]
[:div.report-control-detail {:ref (fn [el]
(when (not= @!box el)