Adds bottom paginator, fixes ledger issue triggered by cash payment, defaults coding to 100 percent

This commit is contained in:
Bryce
2023-06-26 20:33:14 -07:00
parent 4d4678f6f7
commit b6fe435063
20 changed files with 153 additions and 125 deletions

View File

@@ -138,6 +138,24 @@
[:div.level-item c]) children))
[:div.level-right action-buttons]]]))))]))
(defn bottom-paginator [{:keys [start end count total action-buttons]}]
(let [children (r/children (r/current-component))]
[:> Consumer {}
(fn [consume]
(let [{:strs [on-params-change params]} (js->clj consume)]
(r/as-element (into
[:div {:style {:margin-bottom "1rem"}}
[:div.level
(into
[:div.level-left
[:div.level-item
[paginator {:start start :end end :count count :total total
:per-page (:per-page params)
:on-change on-params-change}]]
[:div.level-item
[sort-by-list {:sort (:sort params)
:on-change on-params-change}]]])]]))))]))
(defn table [{:keys [fullwidth class style]}]
(into

View File

@@ -284,10 +284,9 @@
[grid/sortable-header-cell {:sort-key "due" :sort-name "Due" :style {:width "8em"} :class "is-hidden-mobile"} "Due"]
[grid/sortable-header-cell {:sort-key "location" :sort-name "Location" :style {:width "5em"}} "Loc"]
[grid/sortable-header-cell {:sort-key "total" :sort-name "Total" :style {:width "8em"} :class "has-text-right"} "Total"]
[grid/sortable-header-cell {:sort-key "outstanding-balance" :sort-name "Outstanding" :style {:width "10em"} :class "has-text-right"} "Outstanding"]
[grid/header-cell {:style {:width "14rem" }}]
]]
[grid/header-cell {:style {:width "14rem"}}]]]
[grid/body
(for [{:keys [id] :as i} invoices]
@@ -298,4 +297,5 @@
(checkable-fn i)
true)
:actions actions
:overrides overrides}])]])]))
:overrides overrides}])]])
[grid/bottom-paginator data]]))