new balance sheet

This commit is contained in:
2024-10-15 20:46:18 -07:00
parent ca27fcdb57
commit 9d22de1338
5 changed files with 15 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@@ -271,7 +271,7 @@
"limit" 300}))))
valid-clients (for [n name-like-ids
:when (valid-client-ids n)]
{"value" n "label" (pull-attr (dc/db conn) :client/name n) "warning" "this is bad"})]
{"value" n "label" (pull-attr (dc/db conn) :client/name n)})]
{:body (take 10 valid-clients)}))
(def search (wrap-json-response search))

View File

@@ -46,7 +46,7 @@
[:div.shrink.overflow-y-scroll
[:table (merge {:class "w-full text-sm text-left text-gray-500 dark:text-gray-400 shrink"}
(dissoc params :headers :thead-params))
[:thead (update thead-params :class #(-> "text-xs text-gray-800 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400 group-[.raw]:sticky group-[.raw]:top-0"
[:thead (update thead-params :class #(-> "text-xs text-gray-800 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400 group-[.raw]:sticky group-[.raw]:z-10 group-[.raw]:top-0"
(hh/add-class (or % ""))))
(into
[:tr]

View File

@@ -106,7 +106,12 @@
(str (:value c)))
cell-contents (if (:filters c)
(com/link {:hx-get (hu/url investigate-url
(update (:filters c) :numeric-code (fn [nc] (into [] nc))))}
(cond-> {}
(:numeric-code (:filters c)) (assoc :numeric-code (into [] (:numeric-code (:filters c))))
(:date-range (:filters c)) (assoc :end-date (atime/unparse-local (:date-range (:filters c))
atime/normal-date))
(:client-id (:filters c)) (assoc :client-id (:client-id (:filters c))))
)}
cell-contents)
cell-contents)]
[:td.px-4.py-2

View File

@@ -9,7 +9,8 @@
[auto-ap.ssr.ledger.common :refer [grid-page query-schema]]
[auto-ap.ssr.utils :refer [apply-middleware-to-all-handlers
html-response modal-response
wrap-merge-prior-hx wrap-schema-enforce]]))
wrap-merge-prior-hx wrap-schema-enforce]]
[auto-ap.time :as atime]))
(def altered-grid-page
(assoc grid-page
@@ -28,8 +29,9 @@
(defn investigate [request]
(modal-response
(com/modal {:class "max-h-[600px]"}
(com/modal-card {:hx-vals (hx/json (update (:query-params request)
:numeric-code pr-str))
(com/modal-card {:hx-vals (hx/json (-> (:query-params request)
(update :numeric-code pr-str)
(update :end-date #(some-> (atime/unparse-local % atime/normal-date)))))
}
[:div "Ledger entries"]
(table*
@@ -48,7 +50,7 @@
(fn [h]
(-> h
(wrap-copy-qp-pqp)
(wrap-merge-prior-hx)
#_(wrap-merge-prior-hx)
(wrap-schema-enforce :query-schema query-schema)
(wrap-schema-enforce :hx-schema query-schema)
(wrap-must {:activity :read :subject :ledger})