mirror of
https://github.com/mruwnik/chicken-master.git
synced 2025-06-08 21:34:43 +02:00
customers fixes
This commit is contained in:
parent
def43c1bed
commit
c03d2831b9
@ -22,11 +22,12 @@
|
|||||||
:value (:day @state)
|
:value (:day @state)
|
||||||
:class :order-date-picker
|
:class :order-date-picker
|
||||||
:callback (fn [day] (swap! state #(assoc % :day day :open true)))]]
|
:callback (fn [day] (swap! state #(assoc % :day day :open true)))]]
|
||||||
(if (:day @state)
|
(when (:day @state)
|
||||||
[:div
|
[:div
|
||||||
(when (:product-groups who)
|
(when (:product-groups who)
|
||||||
[prod/group-products state])
|
[prod/group-products state])
|
||||||
[prod/products-edit (:products @state)
|
[prod/products-edit (:products @state)
|
||||||
|
:fields (if (config/settings :prices) #{:amount :price} #{:amount})
|
||||||
:getter-fn #(re-frame/dispatch [::event/save-order (assoc @state :products %)])]])])))
|
:getter-fn #(re-frame/dispatch [::event/save-order (assoc @state :products %)])]])])))
|
||||||
|
|
||||||
(defn product-group-adder [who [name {:keys [id products]}]]
|
(defn product-group-adder [who [name {:keys [id products]}]]
|
||||||
@ -40,10 +41,11 @@
|
|||||||
(if (:name @state) "e" "+")]]
|
(if (:name @state) "e" "+")]]
|
||||||
|
|
||||||
[:div {:class :customer-product-group-edit}
|
[:div {:class :customer-product-group-edit}
|
||||||
(html/input :customer-product-group-name "nazwa"
|
(html/input :customer-product-group-name nil
|
||||||
{:default (:name @state)
|
{:default (:name @state)
|
||||||
:on-blur #(swap! state assoc :name (-> % .-target .-value))})
|
:on-blur #(swap! state assoc :name (-> % .-target .-value))})
|
||||||
[prod/products-edit (reagent/atom (or (:products @state) {}))
|
[prod/products-edit (reagent/atom (or (:products @state) {}))
|
||||||
|
:fields (if (config/settings :prices) #{:amount :price} #{:amount})
|
||||||
:getter-fn #(do
|
:getter-fn #(do
|
||||||
(swap! state dissoc :edit)
|
(swap! state dissoc :edit)
|
||||||
(when (and (:name @state) (:products @state))
|
(when (and (:name @state) (:products @state))
|
||||||
@ -64,7 +66,7 @@
|
|||||||
(html/modal
|
(html/modal
|
||||||
:clients
|
:clients
|
||||||
[:div {:class :customers-modal}
|
[:div {:class :customers-modal}
|
||||||
[:h2 "Clienci"]
|
[:h2 "Klienci"]
|
||||||
[prod/item-adder :callback #(re-frame/dispatch [::event/add-customer %]) :button "+"]
|
[prod/item-adder :callback #(re-frame/dispatch [::event/add-customer %]) :button "+"]
|
||||||
(let [client-orders (->> @(re-frame/subscribe [::subs/orders])
|
(let [client-orders (->> @(re-frame/subscribe [::subs/orders])
|
||||||
vals
|
vals
|
||||||
|
Loading…
x
Reference in New Issue
Block a user