Enables Cash flows

This commit is contained in:
2023-04-05 21:46:32 -07:00
parent 6b30da6195
commit 754bfa1848
5 changed files with 108 additions and 16 deletions

View File

@@ -111,11 +111,11 @@ NOTE: Please review the transactions we may have question for you here: https://
{:dispatch [::modal/modal-requested {:title "Your report is ready"
:body [:div
[:div "Click "
[:a {:href (-> result :profit-and-loss-pdf :url) :target "_new"} "here"] " to view it."]
[:a {:href (-> result :cash-flows-pdf :url) :target "_new"} "here"] " to view it."]
(when (and single-client? (seq client-emails))
[: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")}
[:a {:href (str "mailto:" (str/join ";" (map :email client-emails)) "?body=" (email-body (-> result :cash-flows-pdf :url))
"&subject=" (-> result :cash-flows-pdf :name) " is ready")}
"here"] " to open your email client and to send it to " (str/join "," (map (fn [e]
(str (:email e) " (" (:description e) ")"))
client-emails)) "."])]}]})))
@@ -125,7 +125,7 @@ NOTE: Please review the transactions we may have question for you here: https://
(fn [{:keys [db user]}]
(cond-> {:graphql {:token user
:owns-state {:single ::page}
:query-obj {:venia/queries [[:profit-and-loss-pdf
:query-obj {:venia/queries [[:cash-flows-pdf
{:client-ids (map (comp :id :client) (:clients (:data db)))
:include-deltas (:include-deltas (:data db))
:column-per-location (:column-per-location (:data db))
@@ -428,7 +428,7 @@ NOTE: Please review the transactions we may have question for you here: https://
:table table}]]))
(defn profit-and-loss-content []
(defn cash-flows-content []
(let [status @(re-frame/subscribe [::status/single ::page])
{:keys [data report]} @(re-frame/subscribe [::forms/form ::form])]
[:div
@@ -472,7 +472,7 @@ NOTE: Please review the transactions we may have question for you here: https://
(defn cash-flows-page []
(reagent/create-class
{:display-name "profit-and-loss-page"
{:display-name "cash-flows-page"
:component-did-mount #(re-frame/dispatch [::mounted-pnl])
:component-will-unmount #(re-frame/dispatch [::unmounted-pnl])
:reagent-render
@@ -482,7 +482,7 @@ NOTE: Please review the transactions we may have question for you here: https://
(if (not= "manager" (:user/role @user))
[side-bar-layout
{:side-bar [ledger-side-bar]
:main [profit-and-loss-content]
:main [cash-flows-content]
:right-side-bar [appearing-side-bar
{:visible? ledger-list-active?}
[ledger-list]]}]

View File

@@ -34,15 +34,14 @@
[:a.item {:href (bidi/path-for routes/routes :profit-and-loss-detail)
:class [(active-when ap = :profit-and-loss-detail)]}
[:span {:class "icon icon-performance-increase-1" :style {:font-size "25px"}}]
[:span {:class "icon icon-performance-graph-calculator" :style {:font-size "25px"}}]
[:span {:class "name"} "Profit & Loss Detail"]]]
(when (= "admin" (:user/role user))
[:li.menu-item
[:a.item {:href (bidi/path-for routes/routes :cash-flows)
:class [(active-when ap = :cash-flows)]}
[:li.menu-item
[:a.item {:href (bidi/path-for routes/routes :cash-flows)
:class [(active-when ap = :cash-flows)]}
[:span {:class "icon icon-performance-increase-1" :style {:font-size "25px"}}]
[:span {:class "name"} "Cash Flows"]]])
[:span {:class "icon icon-money-wallet-open" :style {:font-size "25px"}}]
[:span {:class "name"} "Cash Flows"]]]
[:li.menu-item
[:a.item {:href (bidi/path-for routes/routes :balance-sheet)
:class [(active-when ap = :balance-sheet)]}