adds unresolved only
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
|
||||
(:require
|
||||
[auto-ap.datomic :refer [add-sorter-fields apply-pagination apply-sort-4
|
||||
conn merge-query observable-query pull-many]]
|
||||
[auto-ap.graphql.utils :refer [extract-client-ids]]
|
||||
[auto-ap.graphql.utils :refer [extract-client-ids is-admin?]]
|
||||
[auto-ap.routes.invoice :as invoice-routes]
|
||||
[auto-ap.routes.ledger :as ledger-routes]
|
||||
[auto-ap.routes.payments :as payment-routes]
|
||||
@@ -32,8 +32,13 @@
|
||||
[:amount-gte {:optional true} [:maybe :double]]
|
||||
[:amount-lte {:optional true} [:maybe :double]]
|
||||
[:client-id {:optional true} [:maybe entity-id]]
|
||||
[:import-batch-id {:optional true} [:maybe entity-id]]
|
||||
[:description {:optional true} [:maybe [:string {:decode/string strip}]]]
|
||||
[:import-batch-id {:optional true} [:maybe entity-id]]
|
||||
[:unresolved {:optional true}
|
||||
[:maybe [:boolean {:decode/string {:enter #(cond (= % "on") true
|
||||
(= % "") false
|
||||
:else
|
||||
(boolean %))}}]]]
|
||||
[:description {:optional true} [:maybe [:string {:decode/string strip}]]]
|
||||
[:vendor {:optional true :default nil} [:maybe [:entity-map {:pull [:db/id :vendor/name]}]]]
|
||||
[:bank-account {:optional true :default nil} [:maybe [:entity-map {:pull [:db/id :bank-account/numeric-code]}]]]
|
||||
#_[:status {:optional true} [:maybe (ref->enum-schema "transaction-status")]]
|
||||
@@ -149,12 +154,19 @@
|
||||
(merge-query {:query {:in ['?vendor-id]
|
||||
:where ['[?e :transaction/vendor ?vendor-id]]}
|
||||
:args [(:db/id (:vendor args))]})
|
||||
(:import-batch-id args)
|
||||
(merge-query {:query {:in ['?import-batch-id]
|
||||
:where ['[?import-batch-id :import-batch/entry ?e]]}
|
||||
:args [(:import-batch-id args)]})
|
||||
(:import-batch-id args)
|
||||
(merge-query {:query {:in ['?import-batch-id]
|
||||
:where ['[?import-batch-id :import-batch/entry ?e]]}
|
||||
:args [(:import-batch-id args)]})
|
||||
|
||||
(:status route-params)
|
||||
(:unresolved args)
|
||||
(merge-query {:query {:where ['[?e :transaction/date]
|
||||
'(or-join [?e]
|
||||
(not [?e :transaction/accounts])
|
||||
(and [?e :transaction/accounts ?tas]
|
||||
(not [?tas :transaction-account/account]))) ]}})
|
||||
|
||||
(:status route-params)
|
||||
(merge-query {:query {:in ['?status]
|
||||
:where ['[?e :transaction/approval-status ?status]]}
|
||||
:args [(:status route-params)]})
|
||||
@@ -269,11 +281,18 @@
|
||||
(com/money-input {:name "amount-lte"
|
||||
:hx-preserve "true"
|
||||
:id "amount-lte"
|
||||
:class "hot-filter w-20"
|
||||
:value (:amount-lte (:query-params request))
|
||||
:placeholder "9999.34"
|
||||
:size :small})])
|
||||
(exact-match-id* request)]])
|
||||
:class "hot-filter w-20"
|
||||
:value (:amount-lte (:query-params request))
|
||||
:placeholder "9999.34"
|
||||
:size :small})])
|
||||
(when (is-admin? (:identity request))
|
||||
[:div.mt-4 {:x-data (hx/json {:unresolvedOnly (:unresolved (:query-params request))})}
|
||||
(com/hidden {:name "unresolved"
|
||||
":value" "unresolvedOnly ? 'on' : ''"})
|
||||
(com/checkbox {:value (:unresolved (:query-params request))
|
||||
:x-model "unresolvedOnly"}
|
||||
"Unresolved only")])
|
||||
(exact-match-id* request)]])
|
||||
|
||||
|
||||
(def grid-page
|
||||
|
||||
Reference in New Issue
Block a user