Adds bottom paginator, fixes ledger issue triggered by cash payment, defaults coding to 100 percent
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]]))
|
||||
|
||||
Reference in New Issue
Block a user