Starting to add locked until
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
[:address [:street1 :street2 :city :state :zip]]])
|
||||
|
||||
(defn client-query [token]
|
||||
(cond-> [:id :name :signature-file :code :email :matches :week-a-debits :week-a-credits :week-b-debits :week-b-credits :locations
|
||||
(cond-> [:id :name :signature-file :code :email :matches :week-a-debits :week-a-credits :week-b-debits :week-b-credits :locations :locked-until
|
||||
[:location-matches [:id :location :match]]
|
||||
[:bank-accounts [:id :start-date :numeric-code :code :number :bank-name :bank-code :check-number :name :routing :type :sort-order :visible :yodlee-account-id
|
||||
[:yodlee-account [:name :id :number]]
|
||||
|
||||
@@ -59,6 +59,11 @@
|
||||
(fn [db [_ multi]]
|
||||
(get-in db [::status multi])))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::last-multi
|
||||
(fn [db [_ multi]]
|
||||
(last (vals (get-in db [::status multi])))))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::single
|
||||
(fn [db [_ single]]
|
||||
|
||||
@@ -72,7 +72,6 @@
|
||||
:which id}
|
||||
:query-obj {:venia/operation {:operation/type :mutation
|
||||
:operation/name "VoidInvoice"}
|
||||
|
||||
:venia/queries [{:query/data [:void-invoice
|
||||
{:invoice-id id}
|
||||
invoice-read]}]}
|
||||
|
||||
@@ -108,6 +108,8 @@
|
||||
:name (:name new-client-data)
|
||||
:code (:code new-client-data) ;; TODO add validation can't change
|
||||
:email (:email new-client-data)
|
||||
|
||||
:locked-until (some-> new-client-data :locked-until #_(date->str standard))
|
||||
:locations (mapv :location (:locations new-client-data))
|
||||
:matches (mapv :match (:matches new-client-data))
|
||||
:location-matches (:location-matches new-client-data)
|
||||
@@ -516,6 +518,16 @@
|
||||
[:input.input {:type "code"
|
||||
:field :code
|
||||
:spec ::entity/code}])])]
|
||||
(field "Locked Until"
|
||||
[date-picker {:class-name "input"
|
||||
:class "input"
|
||||
:format-week-number (fn [] "")
|
||||
:previous-month-button-label ""
|
||||
:placeholder "mm/dd/yyyy"
|
||||
:next-month-button-label ""
|
||||
:next-month-label ""
|
||||
:type "date"
|
||||
:field [:locked-until]}])
|
||||
|
||||
|
||||
(field "Email"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[clojure.string :as str]
|
||||
[re-frame.core :as re-frame]
|
||||
[auto-ap.views.pages.admin.clients.form :as form]
|
||||
[auto-ap.views.utils :refer [action-cell-width]]
|
||||
[auto-ap.views.utils :refer [action-cell-width date->str]]
|
||||
[auto-ap.views.components.grid :as grid]
|
||||
[auto-ap.views.components.buttons :as buttons]))
|
||||
|
||||
@@ -38,16 +38,21 @@
|
||||
[grid/header-cell {} "Name"]
|
||||
[grid/header-cell {:style {:width "20em"}} "Code"]
|
||||
[grid/header-cell {} "Locations"]
|
||||
[grid/header-cell {} "Locked Until"]
|
||||
[grid/header-cell {} "Email"]
|
||||
[grid/header-cell {:style {:width (action-cell-width 1)}}]]
|
||||
]
|
||||
[grid/body
|
||||
(for [{:keys [id name email code locations] :as c} (:data page)]
|
||||
(for [{:keys [id name email locked-until code locations] :as c} (:data page)]
|
||||
^{:key (str name "-" id )}
|
||||
[grid/row {:id id}
|
||||
[grid/cell {} name]
|
||||
[grid/cell {} code]
|
||||
[grid/cell {} (str/join ", " locations)]
|
||||
[grid/cell {} [:div.tag (or (some-> locked-until date->str)
|
||||
"Not locked"
|
||||
|
||||
)]]
|
||||
[grid/cell {} email]
|
||||
[grid/cell {} [buttons/fa-icon {:event [::form/editing id]
|
||||
:icon :fa-pencil}]]])]]])
|
||||
|
||||
@@ -257,7 +257,9 @@
|
||||
current-client @(re-frame/subscribe [::subs/client])]
|
||||
[:div
|
||||
[:h1.title (str (str/capitalize (name (or status :all))) " invoices")]
|
||||
[status/status-notification {:statuses [[::status/single ::print-checks]]}]
|
||||
[status/status-notification {:statuses [[::status/single ::print-checks]
|
||||
[::status/last-multi ::table/void]
|
||||
[::status/last-multi ::table/unvoid]]}]
|
||||
(when (= status :unpaid)
|
||||
[pay-button])
|
||||
[table/invoice-table {:id (:id page)
|
||||
|
||||
Reference in New Issue
Block a user