Adding vendor import stuff.
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
[auto-ap.views.components.sorter :refer [sorted-column]]
|
||||
[reagent.core :as reagent]
|
||||
[clojure.string :as str]
|
||||
[cljs-time.format :as format]))
|
||||
[cljs-time.format :as format]
|
||||
[goog.string :as gstring]))
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +24,7 @@
|
||||
|
||||
|
||||
|
||||
(defn invoice-table [{:keys [id invoice-page status on-params-change vendors params]}]
|
||||
(defn invoice-table [{:keys [id invoice-page status on-params-change vendors params check-boxes on-check-changed]}]
|
||||
(let [state (reagent/atom (or @params {}))
|
||||
opc (fn [p]
|
||||
(swap! state merge p)
|
||||
@@ -40,6 +41,8 @@
|
||||
[:table.table.is-fullwidth
|
||||
[:thead
|
||||
[:tr
|
||||
(when check-boxes
|
||||
[:th])
|
||||
[sorted-column {:on-sort opc
|
||||
:style {:width "25%" :cursor "pointer"}
|
||||
:sort-key "vendor"
|
||||
@@ -78,8 +81,12 @@
|
||||
(for [{:keys [company invoice-number date total id vendor] :as i} (:invoices @invoice-page)]
|
||||
^{:key id}
|
||||
[:tr
|
||||
(when check-boxes
|
||||
[:td [:input.checkbox {:type "checkbox" :on-change (fn [x e] (when on-check-changed
|
||||
(on-check-changed id)))} ]])
|
||||
[:td (:name vendor)]
|
||||
[:td (:name company)]
|
||||
[:td invoice-number]
|
||||
[:td (date->str date) ]
|
||||
[:td total]]))]]]))))
|
||||
|
||||
[:td (gstring/format "$%.2f" total )]]))]]]))))
|
||||
|
||||
Reference in New Issue
Block a user