customized transactions.

This commit is contained in:
Bryce Covert
2020-04-30 07:22:39 -07:00
parent 8043fb0b81
commit 4a6aeaab8f
18 changed files with 184 additions and 126 deletions

View File

@@ -45,7 +45,8 @@
(re-frame/reg-event-db
::editing
(fn [db [_ which potential-payment-matches potential-transaction-rule-matches]]
(let [locations @(re-frame/subscribe [::subs/locations-for-client (:id (:client which))])]
(let [locations @(re-frame/subscribe [::subs/locations-for-client (:id (:client which))])
accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id (:client which)])]
(forms/start-form db ::form
(-> which
(select-keys [:vendor :amount :payment :client :description-original
@@ -59,7 +60,7 @@
(assoc :potential-transaction-rule-matches (if (:matched-rule which)
nil
potential-transaction-rule-matches))
(update :accounts expense-accounts-field/from-graphql (:amount which) locations))))))
(update :accounts expense-accounts-field/from-graphql accounts-by-id (:amount which) locations))))))
(re-frame/reg-event-db
::changed