Fixes P&L page to allow for specific locatiosn

This commit is contained in:
2023-03-10 14:56:58 -08:00
parent b669984673
commit cdf9aa571f
4 changed files with 18 additions and 2 deletions

View File

@@ -212,6 +212,11 @@
(update :filters (fn [f]
(assoc f :location location)))))
(defn filter-locations [pnl-data locations]
(-> pnl-data
(update :filters (fn [f]
(assoc f :locations locations)))))
(defn filter-numeric-code [pnl-data from to]
(-> pnl-data
(update :data (fn [data]
@@ -706,7 +711,8 @@
(filter-location location)
(filter-period period)
(zebra i)))
[(zebra (filter-period pnl-data period) i)])))
[(zebra (filter-locations (filter-period pnl-data period)
(map second (client-locations pnl-data))) i)])))
"All location Summary")]
(for [[client-id location] (client-locations pnl-data)]
(location-summary-table (for [[period i] (map vector (-> pnl-data :args :periods ) (range))]
@@ -728,6 +734,7 @@
(zebra i)))
[(-> pnl-data
(filter-period period)
(filter-locations (map second (client-locations pnl-data)))
(zebra i))])))
nil
"All location Detail"
@@ -743,6 +750,7 @@
(-> pnl-data
(filter-client client-id)
(filter-period period)
(filter-locations (map second (client-locations pnl-data)))
(zebra i)))
(str (-> pnl-data :clients-by-id (get client-id)) " (" location ") Detail")
location))))})