Adds the ability to find unresolved transactions
This commit is contained in:
@@ -101,6 +101,12 @@
|
||||
'[?tas :transaction-account/location ?location]]}
|
||||
:args [(:location args)]})
|
||||
|
||||
(:unresolved args)
|
||||
(merge-query {:query {:where ['(or-join [?e]
|
||||
(not [?e :transaction/accounts])
|
||||
(and [?e :transaction/accounts ?tas]
|
||||
(not [?tas :transaction-account/account])))]}})
|
||||
|
||||
(:description args)
|
||||
(merge-query {:query {:in ['?description]
|
||||
:where ['[?e :transaction/description-original ?do]
|
||||
|
||||
@@ -600,7 +600,8 @@
|
||||
:start {:type 'Int}
|
||||
:per_page {:type 'Int}
|
||||
:sort {:type '(list :sort_item)}
|
||||
:approval_status {:type :transaction_approval_status} }}
|
||||
:approval_status {:type :transaction_approval_status}
|
||||
:unresolved {:type 'Boolean}}}
|
||||
|
||||
:ledger_filters {:fields {:client_id {:type :id}
|
||||
:vendor_id {:type :id}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
:account-id (:id (:account params))
|
||||
:bank-account-id (:id (:bank-account params))
|
||||
:amount-gte (:amount-gte (:amount-range params))
|
||||
:unresolved (:unresolved params)
|
||||
:location (:location params)
|
||||
:amount-lte (:amount-lte (:amount-range params))
|
||||
:description (:description params)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
|
||||
[auto-ap.views.components.number-filter :refer [number-filter]]
|
||||
[auto-ap.views.components.bank-account-filter :refer [bank-account-filter]]
|
||||
[auto-ap.views.components.switch-field :refer [switch-field]]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
|
||||
[bidi.bidi :as bidi]
|
||||
[re-frame.core :as re-frame]
|
||||
@@ -101,5 +102,16 @@
|
||||
[:div.field
|
||||
[:div.control [:input.input {:placeholder "CHECK 123 ABC"
|
||||
:value @(re-frame/subscribe [::data-page/filter data-page :description])
|
||||
:on-change (dispatch-value-change [::data-page/filter-changed data-page :description])} ]]]]]))
|
||||
:on-change (dispatch-value-change [::data-page/filter-changed data-page :description])} ]]]]
|
||||
|
||||
(when (= "admin" (:user/role user))
|
||||
[:<>
|
||||
[:p.menu-label "Admin only"]
|
||||
[:div
|
||||
[switch-field {:id "unresolved-only"
|
||||
:checked (boolean @(re-frame/subscribe [::data-page/filter data-page :unresolved]))
|
||||
:on-change (fn [e]
|
||||
(re-frame/dispatch [::data-page/filter-changed data-page :unresolved (.-checked (.-target e))]))
|
||||
:label "Unresolved only"
|
||||
:type "checkbox"}]]])]))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user