working on ezcater
ezcater other. dajusments. migration for square2
This commit is contained in:
@@ -17,15 +17,36 @@
|
||||
|
||||
(defn row [{sales-order :sales-order
|
||||
selected-client :selected-client}]
|
||||
(let [{:keys [client date total tax tip charges line-items id]} sales-order
|
||||
(let [{:keys [client date total tax tip charges source line-items id]} sales-order
|
||||
expected-deposits (->> charges (filter :expected-deposit) (map :expected-deposit))]
|
||||
[grid/row {:class (:class sales-order) :id id}
|
||||
(when-not selected-client
|
||||
[grid/cell {} (:name client)])
|
||||
[grid/cell {} (date->str date)]
|
||||
[grid/cell {} source]
|
||||
[grid/cell {:class "has-text-right"} (nf total)]
|
||||
[grid/cell {:class "has-text-right"} (nf tax)]
|
||||
[grid/cell {:class "has-text-right"} (nf tip)]
|
||||
[grid/cell {}
|
||||
[:div.level-left
|
||||
(for [charge charges]
|
||||
|
||||
(with-meta
|
||||
(condp = (:type-name charge)
|
||||
"CASH"
|
||||
[:span.icon.level-item {:style {:font-size "24px"}} [:span {:class "icon-accounting-bill" :style {:font-weight "400"}}]]
|
||||
|
||||
"CARD"
|
||||
[:span.icon.level-item {:style {:font-size "24px"}} [:span {:class "icon-credit-card-1" :style {:font-weight "400"}}]]
|
||||
|
||||
"SQUARE_GIFT_CARD"
|
||||
[:span.icon.level-item {:style {:font-size "24px"}} [:span {:class "icon-gift-box" :style {:font-weight "400"}}]]
|
||||
|
||||
[:span.level-item [:span (:type-name charge) (when-let [note (:note charge)]
|
||||
[:span
|
||||
[:i.has-text-grey " (" note ")"]])] ])
|
||||
|
||||
{:key (:id charge)}))]]
|
||||
[grid/cell {}
|
||||
[:div.level
|
||||
[:div.level-left
|
||||
@@ -42,17 +63,15 @@
|
||||
:uber-eats
|
||||
[:img.level-item {:src "/img/ubereats.png" :style {:width "24px" :height "24px"}}]
|
||||
|
||||
(condp = (:type-name charge)
|
||||
"CASH"
|
||||
[:span.icon.level-item {:style {:font-size "24px"}} [:span {:class "icon-accounting-bill" :style {:font-weight "400"}}]]
|
||||
:square
|
||||
[:img.level-item {:src "/img/square.png" :style {:width "24px" :height "24px"}}]
|
||||
|
||||
"CARD"
|
||||
[:span.icon.level-item {:style {:font-size "24px"}} [:span {:class "icon-credit-card-1" :style {:font-weight "400"}}]]
|
||||
:koala
|
||||
[:img.level-item {:src "/img/koala.png" :style {:width "24px" :height "24px"}}]
|
||||
|
||||
"SQUARE_GIFT_CARD"
|
||||
[:span.icon.level-item {:style {:font-size "24px"}} [:span {:class "icon-gift-box" :style {:font-weight "400"}}]]
|
||||
|
||||
[:span.level-item "Other (" (:type-name charge) ")"]))
|
||||
:ezcater
|
||||
[:img.level-item {:src "/img/ezcater.png" :style {:width "24px" :height "24px"}}]
|
||||
nil)
|
||||
|
||||
{:key (:id charge)}))]]]
|
||||
|
||||
@@ -105,10 +124,12 @@
|
||||
(when-not selected-client
|
||||
[grid/sortable-header-cell {:sort-key "client" :sort-name "Client"} "Client"])
|
||||
[grid/sortable-header-cell {:sort-key "date" :sort-name "Date" :style {:width "8em"}} "Date"]
|
||||
[grid/sortable-header-cell {:sort-key "source" :sort-name "Source"} "Source"]
|
||||
[grid/sortable-header-cell {:sort-key "total" :sort-name "Total" :class "has-text-right" :style {:width "8em"}} "Total"]
|
||||
[grid/sortable-header-cell {:sort-key "tax" :sort-name "Tax" :class "has-text-right" :style {:width "7em"}} "Tax"]
|
||||
[grid/sortable-header-cell {:sort-key "tip" :sort-name "Tip" :class "has-text-right" :style {:width "7em"}} "Tip"]
|
||||
[grid/header-cell {} "Payment Methods"]
|
||||
[grid/header-cell {} "Processor"]
|
||||
[grid/header-cell {} "Line Items"]
|
||||
[grid/header-cell {:style {:width "8em"}}]]]
|
||||
[grid/body
|
||||
|
||||
Reference in New Issue
Block a user