showing matched rule.
This commit is contained in:
@@ -90,6 +90,7 @@
|
|||||||
(let [results (->> (d/pull-many db '[* {:transaction/client [:client/name :db/id :client/code]
|
(let [results (->> (d/pull-many db '[* {:transaction/client [:client/name :db/id :client/code]
|
||||||
:transaction/bank-account [:bank-account/name :bank-account/code :bank-account/yodlee-account-id :db/id]
|
:transaction/bank-account [:bank-account/name :bank-account/code :bank-account/yodlee-account-id :db/id]
|
||||||
:transaction/vendor [:db/id :vendor/name]
|
:transaction/vendor [:db/id :vendor/name]
|
||||||
|
:transaction/matched-rule [:db/id :transaction-rule/note]
|
||||||
:transaction/accounts [:transaction-account/amount
|
:transaction/accounts [:transaction-account/amount
|
||||||
:db/id
|
:db/id
|
||||||
:transaction-account/location
|
:transaction-account/location
|
||||||
@@ -117,6 +118,7 @@
|
|||||||
'[* {:transaction/client [:client/name :db/id :client/code :client/locations]
|
'[* {:transaction/client [:client/name :db/id :client/code :client/locations]
|
||||||
:transaction/bank-account [:bank-account/name :bank-account/code :bank-account/yodlee-account-id :db/id]
|
:transaction/bank-account [:bank-account/name :bank-account/code :bank-account/yodlee-account-id :db/id]
|
||||||
:transaction/vendor [:db/id :vendor/name]
|
:transaction/vendor [:db/id :vendor/name]
|
||||||
|
:transaction/matched-rule [:db/id :transaction-rule/note]
|
||||||
:transaction/accounts [:transaction-account/amount
|
:transaction/accounts [:transaction-account/amount
|
||||||
:db/id
|
:db/id
|
||||||
:transaction-account/location
|
:transaction-account/location
|
||||||
|
|||||||
@@ -188,7 +188,8 @@
|
|||||||
:vendor {:type :vendor}
|
:vendor {:type :vendor}
|
||||||
:bank_account {:type :bank_account}
|
:bank_account {:type :bank_account}
|
||||||
:date {:type 'String}
|
:date {:type 'String}
|
||||||
:post_date {:type 'String}}}
|
:post_date {:type 'String}
|
||||||
|
:matched_rule {:type :transaction_rule}}}
|
||||||
|
|
||||||
:transaction_rule {:fields {:id {:type :id}
|
:transaction_rule {:fields {:id {:type :id}
|
||||||
:note {:type 'String}
|
:note {:type 'String}
|
||||||
|
|||||||
@@ -151,6 +151,12 @@
|
|||||||
false
|
false
|
||||||
%))))
|
%))))
|
||||||
|
|
||||||
|
(re-frame/reg-sub
|
||||||
|
::is-admin?
|
||||||
|
:<- [::user]
|
||||||
|
(fn [user]
|
||||||
|
(= "admin" (:user/role user))))
|
||||||
|
|
||||||
(re-frame/reg-sub
|
(re-frame/reg-sub
|
||||||
::user
|
::user
|
||||||
(fn [db]
|
(fn [db]
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
:amount
|
:amount
|
||||||
:location
|
:location
|
||||||
:exclude-from-ledger
|
:exclude-from-ledger
|
||||||
|
[:matched-rule [:note :id]]
|
||||||
[:vendor [:name :id]]
|
[:vendor [:name :id]]
|
||||||
[:accounts [:id :amount :location [:account [:name :id :location :numeric-code]]]]
|
[:accounts [:id :amount :location [:account [:name :id :location :numeric-code]]]]
|
||||||
:date
|
:date
|
||||||
|
|||||||
@@ -49,7 +49,8 @@
|
|||||||
(-> which
|
(-> which
|
||||||
(select-keys [:vendor :amount :payment :client :description-original
|
(select-keys [:vendor :amount :payment :client :description-original
|
||||||
:yodlee-merchant :id :potential-payment-matches
|
:yodlee-merchant :id :potential-payment-matches
|
||||||
:exclude-from-ledger :location :accounts :transaction-approval-status])
|
:exclude-from-ledger :location :accounts :transaction-approval-status
|
||||||
|
:matched-rule])
|
||||||
(assoc :potential-payment-matches potential-payment-matches)
|
(assoc :potential-payment-matches potential-payment-matches)
|
||||||
(update :accounts expense-accounts-field/from-graphql (:amount which) locations))))))
|
(update :accounts expense-accounts-field/from-graphql (:amount which) locations))))))
|
||||||
|
|
||||||
@@ -114,7 +115,6 @@
|
|||||||
|
|
||||||
|
|
||||||
(defn potential-payment-matches-box [{:keys [potential-payment-matches] :as params}]
|
(defn potential-payment-matches-box [{:keys [potential-payment-matches] :as params}]
|
||||||
(println potential-payment-matches)
|
|
||||||
[:div.box
|
[:div.box
|
||||||
[:div.columns
|
[:div.columns
|
||||||
[:div.column
|
[:div.column
|
||||||
@@ -140,10 +140,18 @@
|
|||||||
locations @(re-frame/subscribe [::subs/locations-for-client (:id (:client data))])
|
locations @(re-frame/subscribe [::subs/locations-for-client (:id (:client data))])
|
||||||
{:keys [form field raw-field error-notification submit-button ]} transaction-form]
|
{:keys [form field raw-field error-notification submit-button ]} transaction-form]
|
||||||
[form {:title "Hello" :edit-completed edit-completed}
|
[form {:title "Hello" :edit-completed edit-completed}
|
||||||
[field "Merchant"
|
|
||||||
[:input.input {:type "text"
|
(when @(re-frame/subscribe [::subs/is-admin?])
|
||||||
:field [:yodlee-merchant :name]
|
[field "Merchant"
|
||||||
:disabled "disabled"}]]
|
[:input.input {:type "text"
|
||||||
|
:field [:yodlee-merchant :name]
|
||||||
|
:disabled "disabled"}]])
|
||||||
|
|
||||||
|
(when @(re-frame/subscribe [::subs/is-admin?])
|
||||||
|
[field "Matched Rule"
|
||||||
|
[:input.input {:type "text"
|
||||||
|
:field [:matched-rule :note]
|
||||||
|
:disabled "disabled"}]])
|
||||||
[field "Amount"
|
[field "Amount"
|
||||||
[:input.input {:type "text"
|
[:input.input {:type "text"
|
||||||
:field [:amount]
|
:field [:amount]
|
||||||
|
|||||||
@@ -7,11 +7,12 @@
|
|||||||
[auto-ap.datomic :refer [uri]]))
|
[auto-ap.datomic :refer [uri]]))
|
||||||
(defn wrap-setup
|
(defn wrap-setup
|
||||||
[f]
|
[f]
|
||||||
(d/create-database uri)
|
(with-redefs [auto-ap.datomic/uri "datomic:mem://datomic-transactor:4334/invoice"]
|
||||||
(m/-main false)
|
(d/create-database uri)
|
||||||
(f)
|
(m/-main false)
|
||||||
(d/release (d/connect uri))
|
(f)
|
||||||
(d/delete-database uri))
|
(d/release (d/connect uri))
|
||||||
|
(d/delete-database uri)))
|
||||||
|
|
||||||
(use-fixtures :each wrap-setup)
|
(use-fixtures :each wrap-setup)
|
||||||
(deftest ledger-page
|
(deftest ledger-page
|
||||||
|
|||||||
@@ -8,11 +8,12 @@
|
|||||||
|
|
||||||
(defn wrap-setup
|
(defn wrap-setup
|
||||||
[f]
|
[f]
|
||||||
(d/create-database uri)
|
(with-redefs [auto-ap.datomic/uri "datomic:mem://datomic-transactor:4334/invoice"]
|
||||||
(m/-main false)
|
(d/create-database uri)
|
||||||
(f)
|
(m/-main false)
|
||||||
(d/release (d/connect uri))
|
(f)
|
||||||
(d/delete-database uri))
|
(d/release (d/connect uri))
|
||||||
|
(d/delete-database uri)))
|
||||||
|
|
||||||
(t/use-fixtures :each wrap-setup)
|
(t/use-fixtures :each wrap-setup)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user