correct link throughs

This commit is contained in:
2024-11-11 19:29:17 -08:00
parent 0e5407072e
commit aed9113306
4 changed files with 41 additions and 28 deletions

View File

@@ -1,6 +1,8 @@
(ns auto-ap.ssr.ledger.report-table
(:require
[auto-ap.ssr.components :as com]
[auto-ap.time :as atime]
[clj-time.coerce :as coerce]
[clojure.string :as str]
[hiccup.util :as hu]
[iol-ion.query :as query]))
@@ -19,20 +21,22 @@
(= :percent (:format c))
(format "%%%.1f" (if (query/dollars-0? (:value c))
0.0
(:value c)))
(* 100.0 (or (:value c) 0.0))))
:else
(str (:value c)))
cell-contents (if (:filters c)
(com/link {:hx-get (hu/url investigate-url
(cond-> {}
(:numeric-code (:filters c)) (assoc :numeric-code (into [] (:numeric-code (:filters c))))
;; TODO
#_#_(: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)
(do
(println (:filters c))
(com/link {:hx-get (hu/url investigate-url
(cond-> {}
(:numeric-code (:filters c)) (assoc :numeric-code (into [] (:numeric-code (:filters c))))
(inst? (:date-range (:filters c))) (assoc :end-date (atime/unparse-local (coerce/to-date-time (:date-range (:filters c))) atime/normal-date))
(:end (:date-range (:filters c))) (assoc :end-date (atime/unparse-local (coerce/to-date-time (:end (:date-range (:filters c)))) atime/normal-date))
(:start (:date-range (:filters c))) (assoc :start-date (atime/unparse-local (coerce/to-date-time (:start (: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
(cond-> {:style (cond-> {:width (str width "em")}