tweak for cash flow

This commit is contained in:
Bryce Covert
2022-12-12 14:05:57 -08:00
parent 89c32a95fa
commit e88f015d1d
3 changed files with 116 additions and 57 deletions

View File

@@ -76,7 +76,7 @@
:periods (mapv #(select-keys % #{:start :end} ) (:periods (:data db)))
:include-deltas (:include-deltas (:data db))
:column-per-location (:column-per-location (:data db))}
[[:periods [[:accounts [:name :amount :client_id :account-type :id :count :numeric-code :location]]]]]]]}
[[:periods [[:accounts [:name :amount :debits :credits :client_id :account-type :id :count :numeric-code :location]]]]]]]}
:on-success [::received]}
:set-uri-params {:periods (mapv
encode-period
@@ -379,24 +379,8 @@ NOTE: Please review the transactions we may have question for you here: https://
[form-builder/raw-field-v2 {:field :end}
[date-picker {:output :cljs-date}]]]}]])]]]
[:div.level-item
[:div
[switch-field {:id "include-deltas"
:checked (boolean include-deltas)
:on-change (fn [e]
(re-frame/dispatch [::change
[:include-deltas] (.-checked (.-target e))]))
:label "Include deltas"
:type "checkbox"}]]]
[:div.level-item
[:div
[switch-field {:id "column-per-location"
:checked (boolean column-per-location)
:on-change (fn [e]
(re-frame/dispatch [::change
[:column-per-location] (.-checked (.-target e))]))
:label "Column per location"
:type "checkbox"}]]]]
]
[:div.level-right
[:div.buttons
@@ -418,7 +402,9 @@ NOTE: Please review the transactions we may have question for you here: https://
(map
(fn [a]
(assoc a :period p1
:amount (js/parseFloat (:amount a)))
:amount (js/parseFloat (:amount a))
:debits (js/parseFloat (:debits a))
:credits (js/parseFloat (:credits a)))
)
(:accounts p2)))
(:periods args)))
@@ -437,9 +423,7 @@ NOTE: Please review the transactions we may have question for you here: https://
[rtable/table {:widths (into [20] (take (dec (rtable/cell-count table))
(mapcat identity
(repeat
(if (-> pnl-data :args :include-deltas)
[13 6 13]
[13 6])))))
[13 6]))))
:click-event ::investigate-clicked
:table table}]]))
@@ -474,7 +458,6 @@ NOTE: Please review the transactions we may have question for you here: https://
:clients (mapv (fn [c] {:client c :id (random-uuid)})
(or (:clients qp)
[(some-> @(re-frame/subscribe [::subs/client]) (select-keys [:name :id]) )]))
:include-deltas false
:show-advanced? false})
::track/register {:id ::ledger-params
:subscription [::data-page/params ::ledger]