more fixes.
This commit is contained in:
@@ -204,7 +204,7 @@
|
||||
(re-frame/reg-event-fx
|
||||
::investigate-clicked
|
||||
(fn [{:keys [db] } [_ location from-numeric-code to-numeric-code which]]
|
||||
|
||||
(println from-numeric-code to-numeric-code)
|
||||
{:db (assoc db
|
||||
::ledger-list-active? true
|
||||
::ledger-list-loading true)
|
||||
@@ -298,25 +298,28 @@
|
||||
])))
|
||||
|
||||
(defn overall-grouping [type title location]
|
||||
(list
|
||||
[:tr [:th.has-text-centered title]
|
||||
[:td]
|
||||
[:td]
|
||||
[:td]]
|
||||
(grouping {:accounts @(re-frame/subscribe [::accounts type location])
|
||||
:location location
|
||||
:groupings (type groupings)
|
||||
:comparable-accounts @(re-frame/subscribe [::comparable-accounts-by-id type location])
|
||||
})
|
||||
[:tr [:th.has-text-centered title]
|
||||
[:th.has-text-right [:a
|
||||
{:on-click (dispatch-event [::investigate-clicked location nil nil :current])}
|
||||
(->$ (reduce + 0 (map :amount @(re-frame/subscribe [::accounts type location]))))]]
|
||||
[:th.has-text-right [:a
|
||||
{:on-click (dispatch-event [::investigate-clicked location nil nil :comparable])}
|
||||
(->$ (reduce + 0 (map :amount (vals @(re-frame/subscribe [::comparable-accounts-by-id type location])))))]]
|
||||
[:th.has-text-right (->$ (- (reduce + 0 (map :amount @(re-frame/subscribe [::accounts type location])))
|
||||
(reduce + 0 (map :amount (vals @(re-frame/subscribe [::comparable-accounts-by-id type location]))))))]]))
|
||||
(let [accounts @(re-frame/subscribe [::accounts type location])
|
||||
min-numeric-code (or (first (map :numeric-code accounts)) 0)
|
||||
max-numeric-code (or (last (map :numeric-code accounts)) 0)]
|
||||
(list
|
||||
[:tr [:th.has-text-centered title]
|
||||
[:td]
|
||||
[:td]
|
||||
[:td]]
|
||||
(grouping {:accounts accounts
|
||||
:location location
|
||||
:groupings (type groupings)
|
||||
:comparable-accounts @(re-frame/subscribe [::comparable-accounts-by-id type location])
|
||||
})
|
||||
[:tr [:th.has-text-centered title]
|
||||
[:th.has-text-right [:a
|
||||
{:on-click (dispatch-event [::investigate-clicked location min-numeric-code max-numeric-code :current])}
|
||||
(->$ (reduce + 0 (map :amount @(re-frame/subscribe [::accounts type location]))))]]
|
||||
[:th.has-text-right [:a
|
||||
{:on-click (dispatch-event [::investigate-clicked location min-numeric-code max-numeric-code :comparable])}
|
||||
(->$ (reduce + 0 (map :amount (vals @(re-frame/subscribe [::comparable-accounts-by-id type location])))))]]
|
||||
[:th.has-text-right (->$ (- (reduce + 0 (map :amount @(re-frame/subscribe [::accounts type location])))
|
||||
(reduce + 0 (map :amount (vals @(re-frame/subscribe [::comparable-accounts-by-id type location]))))))]])))
|
||||
|
||||
(def profit-and-loss-content
|
||||
(with-meta
|
||||
|
||||
Reference in New Issue
Block a user