more progress on client form.

This commit is contained in:
2022-07-21 08:34:58 -07:00
parent b214a527fa
commit 22a5f2a707
3 changed files with 29 additions and 45 deletions

View File

@@ -2,6 +2,7 @@
(:require [reagent.core :as r]
[clojure.string :as str]
[auto-ap.views.components.multi :as multi]
[auto-ap.views.components.money-field :as money]
[auto-ap.views.components.number :as number]))
@@ -38,3 +39,5 @@
(def multi-field-v2 multi/multi-field-v2)
(def number-input number/number-input)
(def money-input money/field)

View File

@@ -72,3 +72,6 @@
(defn money-field []
[:f> -money-field (r/props (r/current-component))])
(defn field []
[:f> -money-field (r/props (r/current-component))])

View File

@@ -618,56 +618,34 @@
[form-builder/section {:title "Cash Flow"}
[:label.label (str "Week A (" next-week-a ")")]
[left-stack
[form-builder/field
[form-builder/field-v2 {:field :week-a-credits}
"Regular Credits"
[:input.input {:type "number"
:style {:width "10em"}
:placeholder "500.00"
:field [:week-a-credits]
:step "0.01"}]]
[form-builder/field
[com/money-input]]
[form-builder/field-v2 {:field :week-a-debits}
"Regular Debits"
[:input.input {:type "number"
:style {:width "10em"}
:placeholder "150.00"
:field [:week-a-debits]
:step "0.01"}]]]
[com/money-input]]]
[:label.label (str "Week B (" next-week-b ")")]
[left-stack
[form-builder/field "Regular Credits"
[:input.input {:type "number"
:style {:width "10em"}
:placeholder "1000.00"
:field [:week-b-credits]
:step "0.01"}]]
[form-builder/field "Regular Debits"
[:input.input {:type "number"
:style {:width "10em"}
:placeholder "250.00"
:field [:week-b-debits]
:step "0.01"}]]]
[:div.field
[:label.label "Forecasted transactions"]
[form-builder/field-v2 {:field :week-b-credits}
"Regular Credits"
[com/money-input]]
[form-builder/field-v2 {:field :week-b-debits}
"Regular Debits"
[com/money-input]]]
[:div.control
[form-builder/raw-field
[multi-field {:type "multi-field"
:field :forecasted-transactions
:template [[:input.input {:type "text"
:placeholder "Identifier"
:style {:width "10em"}
:field [ :identifier]}]
[:input.input {:type "number"
:style {:width "8em"}
:placeholder "DOM"
:step "1"
:field [:day-of-month]}]
[:input.input {:type "number"
:placeholder "250.00"
:class "has-text-right"
:style {:width "7em"}
:field [:amount]
:step "0.01"}]]}]]]]]))
[form-builder/field-v2 {:field :forecasted-transactions}
"Forecasted transactions"
[com/multi-field-v2 {:template [[form-builder/raw-field-v2 {:field :identifier}
[:input.input {:type "text"
:placeholder "Identifier"
:style {:width "10em"}}]]
[form-builder/raw-field-v2 {:field :day-of-month}
[com/number-input {:placeholder "DOM"}]]
[form-builder/raw-field-v2 {:field :amount
:placeholder "AMT"}
[com/money-input]]]
:key-fn :id}]]]))
(defn square-section []
(let [{new-client :data} @(re-frame/subscribe [::forms/form ::form])]