not sure if this is a good idea.
This commit is contained in:
@@ -164,7 +164,21 @@
|
||||
visible-checks @(re-frame/subscribe [::visible-checks])
|
||||
visible-expense-accounts @(re-frame/subscribe [::visible-expense-accounts])
|
||||
selected-client @(re-frame/subscribe [::subs/client])
|
||||
percentage-size (if selected-client "%50%" "33%")]
|
||||
percentage-size (if selected-client "%50%" "33%")
|
||||
is-sorted-by-vendor? (seq (filter #(= "vendor" (:sort-key %)) sort))
|
||||
_ (println is-sorted-by-vendor? sort)
|
||||
[invoice-groups] (if is-sorted-by-vendor?
|
||||
(reduce
|
||||
(fn [[acc last-vendor] invoice]
|
||||
(if (not= (:id (:vendor invoice))
|
||||
last-vendor)
|
||||
[(update-in acc [(clojure.core/count acc)] #(conj (or % []) invoice))
|
||||
(:id (:vendor invoice))]
|
||||
[(update-in acc [(dec (clojure.core/count acc))] #(conj (or % []) invoice))
|
||||
(:id (:vendor invoice))]))
|
||||
[[] nil]
|
||||
(:invoices @invoice-page))
|
||||
[[(:invoices @invoice-page)]])]
|
||||
[:div
|
||||
[:div.level
|
||||
[:div.level-left
|
||||
@@ -174,6 +188,9 @@
|
||||
[:div.level-item
|
||||
[sort-by-list {:sort sort
|
||||
:on-change opc}]]]]
|
||||
(doall
|
||||
(for [invoices invoice-groups]
|
||||
^{:key (:id (first invoices))}
|
||||
[:table.table.is-fullwidth
|
||||
[:thead
|
||||
[:tr
|
||||
@@ -245,7 +262,7 @@
|
||||
[:td {:col-span 5}
|
||||
[:i.fa.fa-spin.fa-spinner]]]
|
||||
|
||||
(for [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor] :as i} (:invoices @invoice-page)]
|
||||
(for [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor] :as i} invoices]
|
||||
^{:key id}
|
||||
[row {:invoice i
|
||||
:check-boxes check-boxes
|
||||
@@ -256,4 +273,4 @@
|
||||
:expense-event expense-event
|
||||
:on-edit-invoice on-edit-invoice
|
||||
:on-void-invoice on-void-invoice
|
||||
:on-unvoid-invoice on-unvoid-invoice}]))]]]))
|
||||
:on-unvoid-invoice on-unvoid-invoice}]))]]))]))
|
||||
|
||||
Reference in New Issue
Block a user