adds unresolved only
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
|
|||||||
(:require
|
(:require
|
||||||
[auto-ap.datomic :refer [add-sorter-fields apply-pagination apply-sort-4
|
[auto-ap.datomic :refer [add-sorter-fields apply-pagination apply-sort-4
|
||||||
conn merge-query observable-query pull-many]]
|
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.invoice :as invoice-routes]
|
||||||
[auto-ap.routes.ledger :as ledger-routes]
|
[auto-ap.routes.ledger :as ledger-routes]
|
||||||
[auto-ap.routes.payments :as payment-routes]
|
[auto-ap.routes.payments :as payment-routes]
|
||||||
@@ -32,8 +32,13 @@
|
|||||||
[:amount-gte {:optional true} [:maybe :double]]
|
[:amount-gte {:optional true} [:maybe :double]]
|
||||||
[:amount-lte {:optional true} [:maybe :double]]
|
[:amount-lte {:optional true} [:maybe :double]]
|
||||||
[:client-id {:optional true} [:maybe entity-id]]
|
[:client-id {:optional true} [:maybe entity-id]]
|
||||||
[:import-batch-id {:optional true} [:maybe entity-id]]
|
[:import-batch-id {:optional true} [:maybe entity-id]]
|
||||||
[:description {:optional true} [:maybe [:string {:decode/string strip}]]]
|
[: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]}]]]
|
[: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]}]]]
|
[: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")]]
|
#_[:status {:optional true} [:maybe (ref->enum-schema "transaction-status")]]
|
||||||
@@ -149,12 +154,19 @@
|
|||||||
(merge-query {:query {:in ['?vendor-id]
|
(merge-query {:query {:in ['?vendor-id]
|
||||||
:where ['[?e :transaction/vendor ?vendor-id]]}
|
:where ['[?e :transaction/vendor ?vendor-id]]}
|
||||||
:args [(:db/id (:vendor args))]})
|
:args [(:db/id (:vendor args))]})
|
||||||
(:import-batch-id args)
|
(:import-batch-id args)
|
||||||
(merge-query {:query {:in ['?import-batch-id]
|
(merge-query {:query {:in ['?import-batch-id]
|
||||||
:where ['[?import-batch-id :import-batch/entry ?e]]}
|
:where ['[?import-batch-id :import-batch/entry ?e]]}
|
||||||
:args [(:import-batch-id args)]})
|
: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]
|
(merge-query {:query {:in ['?status]
|
||||||
:where ['[?e :transaction/approval-status ?status]]}
|
:where ['[?e :transaction/approval-status ?status]]}
|
||||||
:args [(:status route-params)]})
|
:args [(:status route-params)]})
|
||||||
@@ -269,11 +281,18 @@
|
|||||||
(com/money-input {:name "amount-lte"
|
(com/money-input {:name "amount-lte"
|
||||||
:hx-preserve "true"
|
:hx-preserve "true"
|
||||||
:id "amount-lte"
|
:id "amount-lte"
|
||||||
:class "hot-filter w-20"
|
:class "hot-filter w-20"
|
||||||
:value (:amount-lte (:query-params request))
|
:value (:amount-lte (:query-params request))
|
||||||
:placeholder "9999.34"
|
:placeholder "9999.34"
|
||||||
:size :small})])
|
:size :small})])
|
||||||
(exact-match-id* request)]])
|
(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
|
(def grid-page
|
||||||
|
|||||||
Reference in New Issue
Block a user