Merge branch 'master' into try-tailwind

merged
This commit is contained in:
Bryce
2023-05-26 16:59:10 -07:00
35 changed files with 1733 additions and 5586 deletions

View File

@@ -77,15 +77,19 @@
(map cleanse)))
(defn get-minimal []
(->> (dc/q '[:find (pull ?e [:client/name :client/code :client/locations :db/id {:client/bank-accounts [{:bank-account/type [:db/ident]}
:bank-account/name
:bank-account/sort-order
:bank-account/bank-name
:bank-account/visible
:bank-account/current-balance
:bank-account/locations
:bank-account/code
:db/id]}])
(->> (dc/q '[:find (pull ?e [:client/name :client/code :client/locations :db/id
{:client/bank-accounts [{:bank-account/type [:db/ident]}
:bank-account/name
:bank-account/sort-order
:bank-account/bank-name
:bank-account/visible
:bank-account/current-balance
:bank-account/locations
:bank-account/code
:db/id]
:client/emails [:db/id
:email-contact/email
:email-contact/description]}])
:where [?e :client/name]]
(dc/db conn))
(map first)
@@ -100,10 +104,10 @@
(defn code->id [code]
(->>
(dc/q (-> {:find ['?e]
:in ['$ '?code]
:where [['?e :client/code '?code ]]}
(dc/db conn) code))
(dc/q '[:find ?e
:in $ ?code
:where [?e :client/code ?code]]
(dc/db conn) code)
(first)
(first)))
@@ -114,7 +118,8 @@
"fields" "id"})
first
:id
Long/parseLong)))
Long/parseLong
(#(hash-map :db/id %)))))
@@ -125,7 +130,8 @@
"fields" "id"})
first
:id
Long/parseLong)))
Long/parseLong
(#(hash-map :db/id %)))))
(defn rebuild-search-index []
(solr/index-documents-raw solr/impl
@@ -171,8 +177,6 @@
true
(merge-query {:query {:find ['?sort-default '?e] :where ['[?e :client/name ?sort-default]]}}))]
(mu/log ::q
:query query)
(->> (query2 query)
(apply-sort-3 (update args :sort conj {:sort-key "default-2" :asc true}))
(apply-pagination args))))

View File

@@ -14,6 +14,7 @@
[auto-ap.time-utils :refer [next-dom]]
[clj-time.coerce :as coerce]
[clj-time.core :as time]
[com.brunobonacci.mulog :as mu]
[clojure.set :refer [rename-keys]]
[datomic.api :as dc]
[iol-ion.tx :refer [random-tempid]]))
@@ -293,6 +294,8 @@
[]))
(defn code-invoice [invoice]
(mu/log ::trying-to-code-invoice
:invoice invoice)
(let [db (dc/db auto-ap.datomic/conn)
client-id (:invoice/client invoice)
vendor-id (:invoice/vendor invoice)