Prevents loading all data

This commit is contained in:
Bryce Covert
2019-10-05 18:50:14 -07:00
parent 6833e8abf5
commit 71e19ee66e

View File

@@ -365,6 +365,11 @@
error @(re-frame/subscribe [::error]) error @(re-frame/subscribe [::error])
params @(re-frame/subscribe [::params])] params @(re-frame/subscribe [::params])]
(if-not current-client
[:div
[:h1.title "Profit and Loss"]
[:h2.title.is-4 "Please choose a client first"]]
[:div [:div
[:h1.title "Profit and Loss"] [:h1.title "Profit and Loss"]
[:h2.title.is-4 "Range"] [:h2.title.is-4 "Range"]
@@ -421,7 +426,7 @@
(date->str (local-now) standard) (date->str (local-now) standard)
"Full year"])} "Full year"])}
"Full year"]]]] "Full year"]]]]
[:div.field.is-grouped [:div.field.is-grouped
[:p.control [:p.control
[:p.help "From"] [:p.help "From"]
[bind-field [bind-field
@@ -481,7 +486,7 @@
(overall-grouping :noncontrollable (str location " Noncontrallable Expenses") location) (overall-grouping :noncontrollable (str location " Noncontrallable Expenses") location)
(subtotal [:controllable :noncontrollable] #{} (str location " Overhead") location) (subtotal [:controllable :noncontrollable] #{} (str location " Overhead") location)
(subtotal [:sales :cogs :payroll :controllable :noncontrollable] #{:cogs :payroll :controllable :noncontrollable} (str location " Net Income") location) (subtotal [:sales :cogs :payroll :controllable :noncontrollable] #{:cogs :payroll :controllable :noncontrollable} (str location " Net Income") location)
(subtotal [:sales :cogs :payroll :controllable :noncontrollable] #{:cogs :payroll :controllable :noncontrollable} "Net Income" nil))))]])])) (subtotal [:sales :cogs :payroll :controllable :noncontrollable] #{:cogs :payroll :controllable :noncontrollable} "Net Income" nil))))]])])))
{:component-will-mount #(re-frame/dispatch-sync [::params-change {:from-date (date->str (t/minus (local-now) (t/period :years 1)) standard) {:component-will-mount #(re-frame/dispatch-sync [::params-change {:from-date (date->str (t/minus (local-now) (t/period :years 1)) standard)
:to-date (date->str (local-now) standard)}]) })) :to-date (date->str (local-now) standard)}]) }))