Starting to add locked until

This commit is contained in:
Bryce Covert
2022-03-13 12:04:59 -07:00
parent 96dd99a74c
commit ab4a426369
12 changed files with 207 additions and 117 deletions

View File

@@ -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]]

View File

@@ -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]]

View File

@@ -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]}]}

View File

@@ -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"

View File

@@ -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}]]])]]])

View File

@@ -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)