close to working dates.

This commit is contained in:
Bryce Covert
2019-02-23 13:12:37 -08:00
parent 00e2c64317
commit 5686a24119
6 changed files with 45 additions and 499 deletions

View File

@@ -19,7 +19,7 @@
[auto-ap.views.components.invoices.side-bar :refer [invoices-side-bar]]
[auto-ap.expense-accounts :as expense-accounts]
[auto-ap.entities.invoices-expense-accounts :as invoices-expense-accounts]
[auto-ap.views.utils :refer [active-when dispatch-event bind-field horizontal-field date->str date-time->str str->date pretty standard]]
[auto-ap.views.utils :refer [active-when dispatch-event bind-field horizontal-field date->str date-time->str str->date pretty standard date-picker]]
[auto-ap.utils :refer [by replace-if]]
[auto-ap.views.pages.check :as check]
[auto-ap.views.components.invoice-table :refer [invoice-table] :as invoice-table]
@@ -259,7 +259,7 @@
(-> db
(forms/start-form ::new-invoice {:client-id (:id @(re-frame/subscribe [::subs/client]))
:status :unpaid
:date (date->str (c/now) standard)
#_#_:date (date->str (c/now) standard)
:location (first (:locations @(re-frame/subscribe [::subs/client])))}))}))
(re-frame/reg-event-db
@@ -557,6 +557,7 @@
::can-submit-edit-invoice
:<- [::forms/form ::new-invoice]
(fn [{:keys [data status]} _]
(println (s/explain-data ::invoice/invoice data))
(let [min-total (if (= (:total (:original data)) (:outstanding-balance (:original data)))
nil
(- (:total (:original data)) (:outstanding-balance (:original data))))]
@@ -610,6 +611,7 @@
:spec ::invoice/date
:subscription handwrite-checks}]]]
[horizontal-field
[:label.label "Check number"]
[bind-field
@@ -698,12 +700,30 @@
[:p.help "Date"]
[:div.control
[bind-field
[:input.input {:type "date"
[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 [:date]
:event change-event
:spec ::invoice/date
:subscription data}]
#_[:input.input {:type "date"
:field [:date]
:event change-event
:spec ::invoice/date
:subscription data}]]]]
#_[horizontal-field
[:label.label "Date 2 "]
]
[:div.field
[:p.help "Invoice #"]
[:div.control