a much better general ledger profit and loss.

This commit is contained in:
Bryce Covert
2020-07-16 22:20:35 -07:00
parent e0b636c2fa
commit 976cd1e7c3
9 changed files with 347 additions and 363 deletions

View File

@@ -137,7 +137,7 @@
(re-frame/reg-event-db
::editing
(fn [db [_ which]]
(let [accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id (:client which)])]
(let [accounts-by-id @(re-frame/subscribe [::subs/all-accounts-by-id (:client which)])]
(-> db (forms/start-form ::form (-> which
(select-keys [:description
:id
@@ -155,7 +155,8 @@
(update :accounts (fn [xs]
(mapv #(-> %
(assoc :amount-percentage (* (:percentage %) 100.0))
(update :account (fn [a] (accounts-by-id (:id a)))))
(update :account (fn [a]
(accounts-by-id (:id a)))))
xs)))))))))