beginning to support new icons.
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
(map #(rename-keys % {:invoice-payment/_invoice :invoice/payments}))))
|
||||
|
||||
(defn raw-graphql [args]
|
||||
(println (:invoice-number-like args))
|
||||
(->> (d/query
|
||||
(cond-> {:query {:find [default-read]
|
||||
:in ['$]
|
||||
@@ -47,7 +48,10 @@
|
||||
(:status args) (add-arg '?status (keyword "invoice-status" (:status args))
|
||||
'[?e :invoice/status ?status])
|
||||
(:vendor-id args) (add-arg '?vendor-id (:vendor-id args)
|
||||
'[?e :invoice/vendor ?vendor-id])))
|
||||
'[?e :invoice/vendor ?vendor-id])
|
||||
(seq (:invoice-number-like args)) (add-arg '?invoice-number-like (:invoice-number-like args)
|
||||
'[?e :invoice/invoice-number ?invoice-number]
|
||||
'[(.contains ^String ?invoice-number ?invoice-number-like)])))
|
||||
(map first)
|
||||
(<-datomic)))
|
||||
|
||||
|
||||
@@ -204,6 +204,7 @@
|
||||
:status {:type 'String}
|
||||
:client_id {:type :id}
|
||||
:vendor_id {:type :id}
|
||||
:invoice_number_like {:type 'String}
|
||||
:start {:type 'Int}
|
||||
:sort_by {:type 'String}
|
||||
:asc {:type 'Boolean}}
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
[:li.menu-item
|
||||
[:a.item {:href (bidi/path-for routes/routes :unpaid-invoices)
|
||||
:class [(active-when ap = :unpaid-invoices)]}
|
||||
[:span {:class "icon"}
|
||||
[:i {:class "fa fa-envelope-open-o"}]]
|
||||
[:span {:class "icon icon-accounting-document" :style {"font-size" "25px"}}]
|
||||
[:span {:class "name"} "Unpaid Invoices"]]]
|
||||
[:li.menu-item
|
||||
[:a.item {:href (bidi/path-for routes/routes :paid-invoices)
|
||||
:class [(active-when ap = :paid-invoices)]}
|
||||
[:span {:class "icon"}
|
||||
[:i {:class "fa fa-envelope-o"}]]
|
||||
|
||||
[:span {:class "icon icon-accounting-invoice-mail" :style {"font-size" "25px"}}]
|
||||
|
||||
[:span {:class "name"} "Paid Invoices"]]]]
|
||||
]
|
||||
[:div
|
||||
|
||||
@@ -92,7 +92,6 @@
|
||||
::toggle-check
|
||||
(fn [db [_ data]]
|
||||
(update-in db [::invoice-page :checked] (fn [x]
|
||||
|
||||
(let [x (or x #{})]
|
||||
(if (x data)
|
||||
(disj x data)
|
||||
@@ -682,7 +681,7 @@
|
||||
|
||||
|
||||
(defn vendor-filter []
|
||||
(let [{:keys [vendor-filter]} @(re-frame/subscribe [::invoice-page])])
|
||||
(let [{:keys [vendor-filter]} @(re-frame/subscribe [::invoice-page])]
|
||||
[:div.field
|
||||
[:div.control
|
||||
[bind-field
|
||||
@@ -693,7 +692,16 @@
|
||||
:text-field [:vendor-name]
|
||||
:event [::change-selected-vendor]
|
||||
:spec (s/nilable ::invoice/vendor-id)
|
||||
:subscription vendor-filter}]]]])
|
||||
:subscription vendor-filter}]]]]))
|
||||
|
||||
(defn invoice-number-filter []
|
||||
(let [{:keys [invoice-number-like] :as params} @(re-frame/subscribe [::params])]
|
||||
[:div.field
|
||||
[:div.control [:input.input {:placeholder "AP-123"
|
||||
:value invoice-number-like
|
||||
:on-change (fn [x]
|
||||
(re-frame/dispatch [::params-change (assoc params :invoice-number-like (.. x -target -value)) ])
|
||||
)} ]]]))
|
||||
|
||||
(def unpaid-invoices-content
|
||||
(with-meta
|
||||
@@ -778,9 +786,13 @@
|
||||
|
||||
(defn unpaid-invoices-page []
|
||||
[side-bar-layout {:side-bar [invoices-side-bar {}
|
||||
[:div [:p.menu-label "Vendor"]
|
||||
[:p.menu-label "Vendor"]
|
||||
[:div
|
||||
[vendor-filter]]
|
||||
]
|
||||
[:p.menu-label "Invoice #"]
|
||||
[:div
|
||||
[invoice-number-filter]
|
||||
]]
|
||||
:main [unpaid-invoices-content]
|
||||
:bottom [vendor-dialog {:vendor @(re-frame/subscribe [::subs/user-editing-vendor])
|
||||
:save-event [::events/save-vendor]
|
||||
|
||||
Reference in New Issue
Block a user