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

View File

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