Merge branch 'master' of codecommit://integreat into try-tailwind
This commit is contained in:
@@ -297,8 +297,10 @@
|
|||||||
(mu/log ::trying-to-code-invoice
|
(mu/log ::trying-to-code-invoice
|
||||||
:invoice invoice)
|
:invoice invoice)
|
||||||
(let [db (dc/db auto-ap.datomic/conn)
|
(let [db (dc/db auto-ap.datomic/conn)
|
||||||
client-id (:invoice/client invoice)
|
client-id (or (:db/id (:invoice/client invoice))
|
||||||
vendor-id (:invoice/vendor invoice)
|
(:invoice/client invoice))
|
||||||
|
vendor-id (or (:db/id (:invoice/vendor invoice))
|
||||||
|
(:invoice/vendor invoice))
|
||||||
date (:invoice/date invoice)
|
date (:invoice/date invoice)
|
||||||
vendor (dc/pull db '[*] vendor-id)
|
vendor (dc/pull db '[*] vendor-id)
|
||||||
due (when (:vendor/terms vendor)
|
due (when (:vendor/terms vendor)
|
||||||
|
|||||||
@@ -184,14 +184,16 @@
|
|||||||
matches))
|
matches))
|
||||||
|
|
||||||
(defn search [context args _]
|
(defn search [context args _]
|
||||||
(let [search-query (str "name:(" (cleanse-query (:query args)) ")")]
|
(if-let [query (not-empty (cleanse-query (:query args)))]
|
||||||
|
(let [search-query (str "name:(" query ")")]
|
||||||
|
|
||||||
|
|
||||||
(for [{:keys [id name]} (solr/query solr/impl "vendors" {"query" (cond-> search-query
|
(for [{:keys [id name]} (solr/query solr/impl "vendors" {"query" (cond-> search-query
|
||||||
(not (is-admin? (:id context))) (str " hidden:false"))
|
(not (is-admin? (:id context))) (str " hidden:false"))
|
||||||
"fields" "id, name"})]
|
"fields" "id, name"})]
|
||||||
{:id (Long/parseLong id)
|
{:id (Long/parseLong id)
|
||||||
:name (first name)})))
|
:name (first name)}))
|
||||||
|
[]))
|
||||||
|
|
||||||
(def single-thread (ex/fixed-thread-executor 1))
|
(def single-thread (ex/fixed-thread-executor 1))
|
||||||
|
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
(-> vendor :vendor/default-account :db/id)
|
(-> vendor :vendor/default-account :db/id)
|
||||||
:invoice-expense-account/location location
|
:invoice-expense-account/location location
|
||||||
:invoice-expense-account/amount (Math/abs (Double/parseDouble invoice-total))
|
:invoice-expense-account/amount (Math/abs (Double/parseDouble invoice-total))
|
||||||
|
:db/id (random-tempid)
|
||||||
}]})))
|
}]})))
|
||||||
(filter :invoice/client)
|
(filter :invoice/client)
|
||||||
(into []))
|
(into []))
|
||||||
|
|||||||
Reference in New Issue
Block a user