started adjusting the transaction form to support splits.
This commit is contained in:
@@ -139,13 +139,10 @@
|
||||
::change-vendor
|
||||
[(forms/in-form ::form)]
|
||||
(fn [{{:keys [data]} :db} [_ location field value]]
|
||||
(println "data" data)
|
||||
(let [has-only-one-expense-account? (and value
|
||||
(or (not (seq (:expense-accounts data)))
|
||||
(<= 1 (count (:expense-accounts data))))
|
||||
(not (get-in data [:expense-accounts 0 :account :id])))]
|
||||
(println "has only one?" has-only-one-expense-account?)
|
||||
|
||||
(if has-only-one-expense-account?
|
||||
{:dispatch [::forms/change ::form
|
||||
field value
|
||||
@@ -296,6 +293,7 @@
|
||||
[bind-field
|
||||
[expense-accounts-field {:subscription data
|
||||
:type "expense-accounts"
|
||||
:descriptor "expense account"
|
||||
:event change-event
|
||||
:locations locations
|
||||
:max-value (:total data)
|
||||
|
||||
Reference in New Issue
Block a user