start of cash flow

This commit is contained in:
Bryce Covert
2020-05-16 16:08:17 -07:00
parent d5dc62cc6a
commit a7a3966f1b
6 changed files with 170 additions and 22 deletions

View File

@@ -165,8 +165,9 @@
visible-expense-accounts @(re-frame/subscribe [::visible-expense-accounts])
selected-client @(re-frame/subscribe [::subs/client])
percentage-size (if selected-client "%50%" "33%")
is-sorted-by-vendor? (seq (filter #(= "vendor" (:sort-key %)) sort))
_ (println is-sorted-by-vendor? sort)
is-loading? (:loading @status)
is-sorted-by-vendor? (and (= "vendor" (:sort-key (first sort)))
(not is-loading?))
[invoice-groups] (if is-sorted-by-vendor?
(reduce
(fn [[acc last-vendor] invoice]
@@ -192,8 +193,8 @@
(for [invoices invoice-groups]
^{:key (:id (first invoices))}
[:table.table.is-fullwidth
[:thead
[:tr
[:thead
[:tr
(when check-boxes
[:th {:style {"width" "20px"}}])
(when-not selected-client
@@ -208,7 +209,9 @@
:sort-name "Vendor"
:sort-key "vendor"
:sort sort}
"Vendor"]
(if is-sorted-by-vendor?
(:name (:vendor (first invoices)))
"Vendor")]
[sorted-column {:on-sort opc
:style {:width percentage-size :cursor "pointer"}
:sort-name "Invoice Number"
@@ -248,20 +251,13 @@
:class "has-text-right"
:sort sort}
"Outstanding"]
[:th {
:style {:width "20rem" :cursor "pointer"}
}
[:th {:style {:width "20rem" :cursor "pointer"}}
""]]]
[:tbody
(if (:loading @status)
[:tr
(if is-loading?
[:tr
[: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]
^{:key id}
[row {:invoice i