excluding some stuff from PNL
This commit is contained in:
@@ -21,7 +21,10 @@
|
||||
::report
|
||||
:comparable-balance-sheet-accounts
|
||||
(map :location)))
|
||||
(filter #(not= "A" %))
|
||||
(filter identity)
|
||||
(set)
|
||||
|
||||
(sort))))
|
||||
|
||||
(re-frame/reg-sub
|
||||
@@ -29,6 +32,11 @@
|
||||
(fn [db]
|
||||
(-> db ::report)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::error
|
||||
(fn [db]
|
||||
(-> db ::error)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::ledger-list-active?
|
||||
(fn [db]
|
||||
@@ -112,6 +120,13 @@
|
||||
(fn [db]
|
||||
(assoc db ::ledger-list-active? false)))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::error
|
||||
(fn [db [_ [error]]]
|
||||
(println (:message error))
|
||||
(assoc db ::error (:message error)
|
||||
::loading false)))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::ledger-list-received
|
||||
(fn [db [_ ledger-list]]
|
||||
@@ -132,7 +147,8 @@
|
||||
:to-date (:to-date params)}
|
||||
[[:balance-sheet-accounts [:name :amount :account-type :id :numeric-code :location]]
|
||||
[:comparable-balance-sheet-accounts [:name :amount :account-type :id :numeric-code :location]]]]]}
|
||||
:on-success [::received]}}))
|
||||
:on-success [::received]
|
||||
:on-error [::error]}}))
|
||||
|
||||
|
||||
|
||||
@@ -309,6 +325,7 @@
|
||||
(fn []
|
||||
(let [current-client @(re-frame/subscribe [::subs/client])
|
||||
user @(re-frame/subscribe [::subs/user])
|
||||
error @(re-frame/subscribe [::error])
|
||||
params @(re-frame/subscribe [::params])]
|
||||
|
||||
[:div
|
||||
@@ -399,8 +416,14 @@
|
||||
:event [::date-picked]
|
||||
:popper-props (clj->js {:placement "right"})
|
||||
:subscription params}]]]]
|
||||
(if @(re-frame/subscribe [::loading])
|
||||
(cond
|
||||
error
|
||||
[:div.notification.is-warning error]
|
||||
|
||||
@(re-frame/subscribe [::loading])
|
||||
[:div [:i.icon.fa.fa-spin.fa-spinner]]
|
||||
|
||||
:else
|
||||
[:div
|
||||
[:table.table.compact.balance-sheet
|
||||
(list
|
||||
@@ -410,7 +433,7 @@
|
||||
[:td.has-text-right (when (:date params)
|
||||
(date->str (t/minus (str->date (:date params) standard) (t/years 1))))]
|
||||
[:td]]
|
||||
(for [location @(re-frame/subscribe [::locations])]
|
||||
(for [location (doto @(re-frame/subscribe [::locations]) println)]
|
||||
(list
|
||||
(overall-grouping :expense location location))))]])]))
|
||||
{:component-will-mount #(re-frame/dispatch-sync [::params-change {:from-date (date->str (t/minus (local-now) (t/period :years 1)) standard)
|
||||
|
||||
Reference in New Issue
Block a user