fixes rule page

This commit is contained in:
2022-05-31 15:57:47 -07:00
parent 49a0684d63
commit 205b17164b
5 changed files with 23 additions and 26 deletions

View File

@@ -43,7 +43,8 @@
:account/name name :account/name name
:account/search-terms name :account/search-terms name
:account/type (keyword "account-type" (clojure.core/name type)) :account/type (keyword "account-type" (clojure.core/name type))
:account/applicability (enum->keyword applicability "account-applicability") :account/applicability (or (enum->keyword applicability "account-applicability")
:account-applicability/global)
:account/account-set account-set :account/account-set account-set
:account/location location :account/location location
:account/numeric-code (when-not id :account/numeric-code (when-not id

View File

@@ -163,6 +163,7 @@
[:div.column.is-narrow [:div.column.is-narrow
[:p.help "Location"] [:p.help "Location"]
[:div.control [:div.control
(println account)
(if-let [forced-location (:location account)] (if-let [forced-location (:location account)]
[:div.select [:div.select
[:select {:disabled "disabled" :style {:width "5em"} :value forced-location} [:option {:value forced-location} forced-location]]] [:select {:disabled "disabled" :style {:width "5em"} :value forced-location} [:option {:value forced-location} forced-location]]]

View File

@@ -108,7 +108,6 @@
chooseable-expense-accounts @(re-frame/subscribe [::subs/all-accounts]) chooseable-expense-accounts @(re-frame/subscribe [::subs/all-accounts])
change-event [::all-events/change-form [::expense-accounts]]] change-event [::all-events/change-form [::expense-accounts]]]
(println form)
[:div [:div
[:h1.title "Import Invoices from Integreat Excel"] [:h1.title "Import Invoices from Integreat Excel"]
(when (seq vendors-not-found) (when (seq vendors-not-found)

View File

@@ -12,8 +12,7 @@
[:vendor [:name :id]] [:vendor [:name :id]]
[:client [:name :id]] [:client [:name :id]]
[:bank-account [:name :id]] [:bank-account [:name :id]]
[:accounts [[:account [:id :name :numeric-code]] [:accounts [[:account [:id :name :numeric-code :location]]
:id :id
:percentage :percentage
:location]] :location]]])
])

View File

@@ -146,27 +146,24 @@
(re-frame/reg-event-db (re-frame/reg-event-db
::editing ::editing
(fn [db [_ which]] (fn [db [_ which]]
(let [accounts-by-id @(re-frame/subscribe [::subs/all-accounts-by-id (:client which)])] (-> db (forms/start-form ::form (-> which
(-> db (forms/start-form ::form (-> which (select-keys [:description
(select-keys [:description :id
:id :client
:client :bank-account
:bank-account :note
:note :amount-lte
:amount-lte :amount-gte
:amount-gte :dom-lte
:dom-lte :dom-gte
:dom-gte :vendor
:vendor :accounts
:accounts :yodlee-merchant
:yodlee-merchant :transaction-approval-status])
:transaction-approval-status]) (update :accounts (fn [xs]
(update :accounts (fn [xs] (mapv #(-> %
(mapv #(-> % (assoc :amount-percentage (* (:percentage %) 100.0)))
(assoc :amount-percentage (* (:percentage %) 100.0)) xs))))))))
(update :account (fn [a]
(accounts-by-id (:id a)))))
xs)))))))))
(re-frame/reg-event-fx (re-frame/reg-event-fx