tweaks
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
:refer [entity-id ref->enum-schema wrap-schema-enforce]]
|
||||
[com.brunobonacci.mulog :as mu]
|
||||
[datomic.api :as dc]
|
||||
[ring.middleware.json :refer [wrap-json-response]]))
|
||||
[ring.middleware.json :refer [wrap-json-response]]
|
||||
[auto-ap.datomic.accounts :as d-accounts]))
|
||||
|
||||
;; TODO this is basically duplicative of graphql version, make sure to keep in sync
|
||||
;; TODO use valid clients from request rather than stuff like assert-can-see-client
|
||||
@@ -17,9 +18,13 @@
|
||||
(def search-pattern [:db/id
|
||||
:account/numeric-code
|
||||
:account/location
|
||||
:account/name
|
||||
{:account/vendor-allowance [:db/ident]
|
||||
:account/default-allowance [:db/ident]
|
||||
:account/invoice-allowance [:db/ident]}])
|
||||
:account/invoice-allowance [:db/ident]
|
||||
:account/client-overrides [:db/id
|
||||
:account-client-override/name
|
||||
{:account-client-override/client [:db/id :client/name]}]} ])
|
||||
|
||||
(defn search- [id query client]
|
||||
(let [client-part (if (some->> client (can-see-client? id))
|
||||
@@ -67,7 +72,9 @@
|
||||
(valid-allowances (-> a allowance :db/ident))
|
||||
(= (:db/id a) vendor-account))))
|
||||
(map (fn [[n a]]
|
||||
{:label (str (:account/numeric-code a) " - " n)
|
||||
{:label (str (:account/numeric-code a) " - " (if client-id
|
||||
(:account/name (d-accounts/clientize a client-id))
|
||||
n))
|
||||
:value (:db/id a)
|
||||
:location (:account/location a)
|
||||
:warning (when (= :allowance/warn (-> a allowance :db/ident))
|
||||
|
||||
Reference in New Issue
Block a user