Checks now have a status that gets updated

This commit is contained in:
Bryce
2018-06-30 10:24:41 -07:00
parent e7515e5a00
commit 05c9fa8fd8
6 changed files with 29 additions and 5 deletions

View File

@@ -36,7 +36,7 @@
:graphql {:token (-> cofx :db :user)
:query-obj {:venia/queries [[:check_page
(assoc params :company-id (:id @(re-frame/subscribe [::subs/company])))
[[:checks [:id :amount :check_number :s3_url :date [:vendor [:name :id]] [:company [:name :id]]]]
[[:checks [:id :status :amount :check_number :s3_url :date [:vendor [:name :id]] [:company [:name :id]]]]
:total
:start
:end]]]}
@@ -104,6 +104,13 @@
:sort-by sort-by
:asc asc}
"Amount"]
[sorted-column {:on-sort opc
:style {:width "8em" :cursor "pointer"}
:sort-key "status"
:sort-by sort-by
:asc asc}
"Status"]
[:th {:style {:width "10em"}} "" ]]]
@@ -112,7 +119,7 @@
[:tr
[:td {:col-span 5}
[:i.fa.fa-spin.fa-spinner]]]
(for [{:keys [company s3-url checks check-number date amount id vendor] :as i} (:checks @check-page)]
(for [{:keys [company s3-url checks check-number date amount id vendor status] :as i} (:checks @check-page)]
^{:key id}
[:tr {:class (:class i)}
@@ -121,6 +128,7 @@
[:td check-number]
[:td (date->str date) ]
[:td (gstring/format "$%.2f" amount )]
[:td status]
[:td
(if s3-url
[:a.tag {:href s3-url :target "_new"} [:i.fa.fa-money-check] [:span.icon [:i.fa.fa-money]] (str " " check-number " (" (gstring/format "$%.2f" amount ) ")")]