User interface for seeing food apps

This commit is contained in:
2021-06-05 07:38:24 -07:00
parent 002dcfc5ac
commit 88c4357dac
18 changed files with 221 additions and 17 deletions

View File

@@ -27,7 +27,7 @@
:date-range (:date-range params)
:client-id (:id @(re-frame/subscribe [::subs/client]))}
[[:sales-orders [:id :total :tax :tip :discount :service-charge :returns :date
[:charges [:type-name :total :processor]]
[:charges [:type-name :total :processor :id]]
[:line-items [:item-name :total :category]]
[:client [:name :id]]]]
:total

View File

@@ -17,8 +17,37 @@
[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 {} (str/join ", " (map (fn [c]
(str (:type-name c) " (" (name (:processor c)) ")")) charges))]
[grid/cell {}
[:div.level
[:div.level-left
(for [charge charges]
(with-meta
(condp = (:processor charge)
:grubhub
[:img.level-item {:src "/img/grubhub.png" :style {:width "24px" :height "24px"}}]
:doordash
[:img.level-item {:src "/img/doordash.png" :style {:width "24px" :height "24px"}}]
: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"}}]]
"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 "Other (" (:type-name charge) ")"]
))
{:key (:id charge)}))]]
]
[grid/cell {} (str/join ", " (map :item-name line-items))]
[grid/button-cell {}
[:div.buttons