stuff
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -157,35 +157,38 @@
|
|||||||
(if account-id
|
(if account-id
|
||||||
[:span.text-sm account-name]
|
[:span.text-sm account-name]
|
||||||
(com/pill {:color :red} "Missing acct"))
|
(com/pill {:color :red} "Missing acct"))
|
||||||
(com/a-icon-button {:hx-get (bidi/path-for ssr-routes/only-routes ::route/edit-item-account)
|
(com/a-icon-button {:class "p-1"
|
||||||
:hx-target "closest .account-cell"
|
:hx-get (bidi/path-for ssr-routes/only-routes ::route/edit-item-account)
|
||||||
:hx-swap "outerHTML"
|
:hx-target "closest .account-cell"
|
||||||
:hx-vals (hx/json {:item-index (or (:item-index item) 0)
|
:hx-swap "outerHTML"
|
||||||
:client-id client-id
|
:hx-vals (hx/json {:item-index (or (:item-index item) 0)
|
||||||
:current-account-id (or account-id "")})}
|
:client-id client-id
|
||||||
svg/pencil)]))
|
:current-account-id (or account-id "")})}
|
||||||
|
svg/pencil)]))
|
||||||
|
|
||||||
(defn account-edit-cell [{:keys [field-name-prefix client-id current-account-id]}]
|
(defn account-edit-cell [{:keys [field-name-prefix client-id current-account-id]}]
|
||||||
(let [account-input-name (str field-name-prefix "[ledger-mapped/account]")]
|
(let [account-input-name (str field-name-prefix "[ledger-mapped/account]")]
|
||||||
[:div.account-cell.flex.flex-col.gap-2
|
[:div.account-cell.flex.flex-col.gap-2
|
||||||
(account-typeahead* {:name account-input-name
|
(account-typeahead* {:name account-input-name
|
||||||
:value current-account-id
|
:value current-account-id
|
||||||
:client-id client-id}
|
:client-id client-id})
|
||||||
[:div.flex.gap-1
|
[:div.flex.gap-1
|
||||||
(com/a-icon-button {:hx-put (bidi/path-for ssr-routes/only-routes ::route/save-item-account)
|
(com/a-icon-button {:class "p-1"
|
||||||
:hx-target "closest .account-cell"
|
:hx-put (bidi/path-for ssr-routes/only-routes ::route/save-item-account)
|
||||||
:hx-swap "outerHTML"
|
:hx-target "closest .account-cell"
|
||||||
:hx-include "closest .account-cell"}
|
:hx-swap "outerHTML"
|
||||||
:hx-vals (hx/json {:field-name-prefix field-name-prefix
|
:hx-include "closest .account-cell"
|
||||||
:client-id client-id})
|
:hx-vals (hx/json {:field-name-prefix field-name-prefix
|
||||||
svg/check)
|
:client-id client-id})}
|
||||||
(com/a-icon-button {:hx-get (bidi/path-for ssr-routes/only-routes ::route/cancel-item-account)
|
svg/check)
|
||||||
:hx-target "closest .account-cell"
|
(com/a-icon-button {:class "p-1"
|
||||||
:hx-swap "outerHTML"
|
:hx-get (bidi/path-for ssr-routes/only-routes ::route/cancel-item-account)
|
||||||
:hx-vals (hx/json {:field-name-prefix field-name-prefix}
|
:hx-target "closest .account-cell"
|
||||||
:client-id client-id
|
:hx-swap "outerHTML"
|
||||||
:current-account-id (or current-account-id ""))}
|
:hx-vals (hx/json {:field-name-prefix field-name-prefix
|
||||||
svg/x)])]))
|
:client-id client-id
|
||||||
|
:current-account-id (or current-account-id "")})}
|
||||||
|
svg/x)]]))
|
||||||
|
|
||||||
(def grid-page
|
(def grid-page
|
||||||
(helper/build {:id "entity-table"
|
(helper/build {:id "entity-table"
|
||||||
@@ -573,8 +576,8 @@
|
|||||||
[:span.text-gray-500 (truncate (:sales-summary-item/category item) 30)]
|
[:span.text-gray-500 (truncate (:sales-summary-item/category item) 30)]
|
||||||
(account-display-cell {:item (assoc item :item-index actual-idx)
|
(account-display-cell {:item (assoc item :item-index actual-idx)
|
||||||
:field-name-prefix (str "step-params[sales-summary/items][" actual-idx "]")
|
:field-name-prefix (str "step-params[sales-summary/items][" actual-idx "]")
|
||||||
:client-id client-id})
|
:client-id client-id})
|
||||||
[:span.font-mono.tabular-nums.text-gray-900 (format "$%,.2f" (:ledger-mapped/amount item))]]))
|
[:span.ml-auto.font-mono.tabular-nums.text-gray-900 (format "$%,.2f" (:ledger-mapped/amount item))]]))
|
||||||
[:div.h-6]))]
|
[:div.h-6]))]
|
||||||
[:div.mt-2.border-t.pt-1
|
[:div.mt-2.border-t.pt-1
|
||||||
(summary-total-display request)
|
(summary-total-display request)
|
||||||
@@ -616,13 +619,13 @@
|
|||||||
[:span.text-gray-500 (truncate (:sales-summary-item/category item) 30)]
|
[:span.text-gray-500 (truncate (:sales-summary-item/category item) 30)]
|
||||||
(account-display-cell {:item (assoc item :item-index actual-idx)
|
(account-display-cell {:item (assoc item :item-index actual-idx)
|
||||||
:field-name-prefix (str "step-params[sales-summary/items][" actual-idx "]")
|
:field-name-prefix (str "step-params[sales-summary/items][" actual-idx "]")
|
||||||
:client-id client-id})
|
:client-id client-id})
|
||||||
[:span.font-mono.tabular-nums.text-gray-900 (format "$%,.2f" (:ledger-mapped/amount item))]]))
|
[:span.ml-auto.font-mono.tabular-nums.text-gray-900 (format "$%,.2f" (:ledger-mapped/amount item))]]))
|
||||||
[:div.h-6]))]
|
[:div.h-6]))]
|
||||||
[:div.mt-2.border-t.pt-1
|
[:div.mt-2.border-t.pt-1
|
||||||
(summary-total-display request)
|
(summary-total-display request)
|
||||||
(unbalanced-display request)]]]
|
(unbalanced-display request)]]]
|
||||||
[:div.mt-4.border-t.pt-2
|
[:div.mt-4.border-t.pt-2
|
||||||
(fc/with-field :sales-summary/items
|
(fc/with-field :sales-summary/items
|
||||||
(com/data-grid-new-row {:colspan 2
|
(com/data-grid-new-row {:colspan 2
|
||||||
:hx-get (bidi/path-for ssr-routes/only-routes ::route/new-summary-item)
|
:hx-get (bidi/path-for ssr-routes/only-routes ::route/new-summary-item)
|
||||||
|
|||||||
Reference in New Issue
Block a user