shows as locked
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -518,4 +518,14 @@
|
|||||||
[:defs]
|
[:defs]
|
||||||
[:title "undo"]
|
[:title "undo"]
|
||||||
[:path {:d "m1.5 0.498 0 7 7 0", :fill "none", :stroke "currentcolor", :stroke-linecap "round", :stroke-linejoin "round", :stroke-width "1"}]
|
[:path {:d "m1.5 0.498 0 7 7 0", :fill "none", :stroke "currentcolor", :stroke-linecap "round", :stroke-linejoin "round", :stroke-width "1"}]
|
||||||
[:path {:d "M1.5 7.5a11.656 11.656 0 0 1 16.179 -2.647 11.508 11.508 0 0 1 0.11 18.645", :fill "none", :stroke "currentcolor", :stroke-linecap "round", :stroke-linejoin "round", :stroke-width "1"}]])
|
[:path {:d "M1.5 7.5a11.656 11.656 0 0 1 16.179 -2.647 11.508 11.508 0 0 1 0.11 18.645", :fill "none", :stroke "currentcolor", :stroke-linecap "round", :stroke-linejoin "round", :stroke-width "1"}]])
|
||||||
|
|
||||||
|
(def lock
|
||||||
|
[:svg {:xmlns "http://www.w3.org/2000/svg", :viewbox "0 0 24 24", :id "Lock-1--Streamline-Streamline-3.0", :height "24", :width "24"}
|
||||||
|
[:desc "Lock 1 Streamline Icon: https://streamlinehq.com"]
|
||||||
|
[:defs]
|
||||||
|
[:title "lock-1"]
|
||||||
|
[:path {:d "M11 15a1 1 0 1 0 2 0 1 1 0 1 0 -2 0", :fill "none", :stroke "currentColor", :stroke-linecap "round", :stroke-linejoin "round", :stroke-width "1"}]
|
||||||
|
[:path {:d "m12 16 0 3", :fill "none", :stroke "currentColor", :stroke-linecap "round", :stroke-linejoin "round", :stroke-width "1"}]
|
||||||
|
[:path {:d "M4.5 9.5h15s1 0 1 1v12s0 1 -1 1h-15s-1 0 -1 -1v-12s0 -1 1 -1", :fill "none", :stroke "currentColor", :stroke-linecap "round", :stroke-linejoin "round", :stroke-width "1"}]
|
||||||
|
[:path {:d "M6.5 6a5.5 5.5 0 0 1 11 0v3.5h-11Z", :fill "none", :stroke "currentColor", :stroke-linecap "round", :stroke-linejoin "round", :stroke-width "1"}]])
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
[auto-ap.time :as atime]
|
[auto-ap.time :as atime]
|
||||||
[bidi.bidi :as bidi]
|
[bidi.bidi :as bidi]
|
||||||
[clj-time.coerce :as coerce]
|
[clj-time.coerce :as coerce]
|
||||||
|
[clj-time.core :as time]
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[datomic.api :as dc]
|
[datomic.api :as dc]
|
||||||
[hiccup.util :as hu]
|
[hiccup.util :as hu]
|
||||||
@@ -212,7 +213,7 @@
|
|||||||
:transaction/client-overrides
|
:transaction/client-overrides
|
||||||
:db/id
|
:db/id
|
||||||
{:transaction/vendor [:vendor/name :db/id]
|
{:transaction/vendor [:vendor/name :db/id]
|
||||||
:transaction/client [:client/name :client/code :db/id]
|
:transaction/client [:client/name :client/code :db/id [ :client/locked-until :xform clj-time.coerce/from-date]]
|
||||||
:transaction/bank-account [:bank-account/numeric-code :bank-account/name]
|
:transaction/bank-account [:bank-account/numeric-code :bank-account/name]
|
||||||
:transaction/accounts [{:transaction-account/account [:account/name :db/id]}
|
:transaction/accounts [{:transaction-account/account [:account/name :db/id]}
|
||||||
:transaction-account/location
|
:transaction-account/location
|
||||||
@@ -282,15 +283,22 @@
|
|||||||
[(assoc-in (date-range-field* request) [1 :hx-swap-oob] true)
|
[(assoc-in (date-range-field* request) [1 :hx-swap-oob] true)
|
||||||
(assoc-in (exact-match-id* request) [1 :hx-swap-oob] true)])
|
(assoc-in (exact-match-id* request) [1 :hx-swap-oob] true)])
|
||||||
:action-buttons (fn [request]
|
:action-buttons (fn [request]
|
||||||
[(com/button {:color :primary
|
[#_(com/button {:color :primary
|
||||||
:hx-get (bidi/path-for ssr-routes/only-routes
|
:hx-get (bidi/path-for ssr-routes/only-routes
|
||||||
::route/new)}
|
::route/new)}
|
||||||
"Add Transaction")])
|
"Add Transaction")])
|
||||||
:row-buttons (fn [request entity]
|
:row-buttons (fn [request entity]
|
||||||
[(com/icon-button {:hx-get (bidi/path-for ssr-routes/only-routes
|
(let [client (:transaction/client entity)
|
||||||
::route/edit-wizard
|
locked-until (:client/locked-until client)
|
||||||
:db/id (:db/id entity))}
|
tx-date (:transaction/date entity)
|
||||||
svg/pencil)])
|
is-locked (and locked-until tx-date (time/before? tx-date locked-until))]
|
||||||
|
(if is-locked
|
||||||
|
[ [:div.p-3.rounded-full.bg-gray-50.text-gray-400.w-6.h-6.box-content
|
||||||
|
svg/lock]]
|
||||||
|
[(com/icon-button {:hx-get (bidi/path-for ssr-routes/only-routes
|
||||||
|
::route/edit-wizard
|
||||||
|
:db/id (:db/id entity))}
|
||||||
|
svg/pencil)])))
|
||||||
|
|
||||||
:breadcrumbs [[:a {:href (bidi/path-for ssr-routes/only-routes ::route/page)}
|
:breadcrumbs [[:a {:href (bidi/path-for ssr-routes/only-routes ::route/page)}
|
||||||
"Transactions"]]
|
"Transactions"]]
|
||||||
|
|||||||
Reference in New Issue
Block a user