Add vendor pre-population for bulk code and individual edit forms

- Add vendor-changed HTMX handlers for both bulk code and individual edit
- Pre-populate default account at 100% when vendor is selected and no accounts exist
- Fix render-accounts-section to render from step-params correctly
- Change bulk code vendor-changed from hx-get to hx-post to include form data
- Add routes for vendor-changed endpoints
- Update e2e tests to cover vendor pre-population
- Run lein cljfmt fix across codebase
This commit is contained in:
2026-05-21 14:45:19 -07:00
parent 8bd0cee1b1
commit ba87805d4c
210 changed files with 8694 additions and 9627 deletions

View File

@@ -36,7 +36,7 @@
"date" ['[?e :expected-deposit/date ?sort-date]]
"total" ['[?e :expected-deposit/total ?sort-total]]
"fee" ['[?e :expected-deposit/fee ?sort-fee]]}
args)
args)
true
(merge-query {:query {:in ['[?xx ...]]
@@ -58,13 +58,13 @@
'[?client-id :client/code ?client-code]]}
:args [(:client-code args)]})
(:total-gte args)
(:total-gte args)
(merge-query {:query {:in ['?total-gte]
:where ['[?e :expected-deposit/total ?a]
'[(>= ?a ?total-gte)]]}
:args [(:total-gte args)]})
(:total-lte args)
(:total-lte args)
(merge-query {:query {:in ['?total-lte]
:where ['[?e :expected-deposit/total ?a]
'[(<= ?a ?total-lte)]]}
@@ -76,7 +76,6 @@
'[(iol-ion.query/dollars= ?expected-deposit-total ?total)]]}
:args [(:total args)]})
(:start (:date-range args))
(merge-query {:query {:in '[?start-date]
:where ['[?e :expected-deposit/date ?date]
@@ -92,7 +91,7 @@
true
(merge-query {:query {:find ['?sort-default '?e]
:where ['[?e :expected-deposit/date ?sort-default]]}}))]
(cond->> (query2 query)
true (apply-sort-3 args)
true (apply-pagination args))))
@@ -101,26 +100,26 @@
(let [results (->> (pull-many db default-read ids)
(group-by :db/id))
payments (->> ids
(map results)
(map first)
(mapv <-datomic)
(map (fn get-totals [ed]
(assoc ed :totals
(->> (dc/q '[:find ?d4 (count ?c) (sum ?a)
:in $ ?ed
:where [?ed :expected-deposit/charges ?c]
[?c :charge/total ?a]
[?o :sales-order/charges ?c]
[?o :sales-order/date ?d]
[(clj-time.coerce/from-date ?d) ?d2]
[(auto-ap.time/localize ?d2) ?d3]
[(clj-time.coerce/to-local-date ?d3) ?d4]]
(dc/db conn)
(:db/id ed))
(map (fn [[date count amount]]
{:date (c/to-date-time date)
:count count
:amount amount})))))))]
(map results)
(map first)
(mapv <-datomic)
(map (fn get-totals [ed]
(assoc ed :totals
(->> (dc/q '[:find ?d4 (count ?c) (sum ?a)
:in $ ?ed
:where [?ed :expected-deposit/charges ?c]
[?c :charge/total ?a]
[?o :sales-order/charges ?c]
[?o :sales-order/date ?d]
[(clj-time.coerce/from-date ?d) ?d2]
[(auto-ap.time/localize ?d2) ?d3]
[(clj-time.coerce/to-local-date ?d3) ?d4]]
(dc/db conn)
(:db/id ed))
(map (fn [[date count amount]]
{:date (c/to-date-time date)
:count count
:amount amount})))))))]
payments))
(defn get-graphql [args]