big updates for re-org.
This commit is contained in:
34
src/cljs/auto_ap/views/pages/paid_invoices.cljs
Normal file
34
src/cljs/auto_ap/views/pages/paid_invoices.cljs
Normal file
@@ -0,0 +1,34 @@
|
||||
(ns auto-ap.views.pages.paid-invoices
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[auto-ap.subs :as subs]
|
||||
[auto-ap.events :as events]))
|
||||
|
||||
|
||||
(def paid-invoices-page
|
||||
(with-meta
|
||||
(fn []
|
||||
(let [invoices (re-frame/subscribe [::subs/unpaid-invoices])
|
||||
status (re-frame/subscribe [::subs/status])]
|
||||
[:div {:class "inbox-messages"}
|
||||
[:h1.title "Paid invoices"]
|
||||
(if (:loading @status)
|
||||
[:div {:class "inbox-messages"}
|
||||
[:h1.title
|
||||
[:i.fa.fa-spin.fa-spinner]]]
|
||||
[:table {:class "table", :style {:width "100%"}}
|
||||
[:thead
|
||||
[:tr
|
||||
[:th "Vendor"]
|
||||
[:th "Customer"]
|
||||
[:th "Invoice #"]
|
||||
[:th "Date"]
|
||||
[:th "Amount"]]]
|
||||
[:tbody (for [{:keys [company invoice-number date total id vendor] :as i} @invoices]
|
||||
^{:key (str company "-" invoice-number "-" date "-" total "-" id)}
|
||||
[:tr
|
||||
[:td vendor]
|
||||
[:td company]
|
||||
[:td invoice-number]
|
||||
[:td date]
|
||||
[:td total]])]])]))
|
||||
{:component-will-mount #(re-frame/dispatch-sync [::events/view-unpaid-invoices]) }))
|
||||
Reference in New Issue
Block a user