make orders upsertable.
This commit is contained in:
@@ -251,6 +251,11 @@
|
|||||||
:db/valueType :db.type/string
|
:db/valueType :db.type/string
|
||||||
:db/cardinality :db.cardinality/one
|
:db/cardinality :db.cardinality/one
|
||||||
:db/unique :db.unique/identity}]]}
|
:db/unique :db.unique/identity}]]}
|
||||||
|
:add-line-item-id2 {:txes [[{:db/ident :order-line-item/external-id
|
||||||
|
:db/doc "An Id that links to square etc"
|
||||||
|
:db/valueType :db.type/string
|
||||||
|
:db/cardinality :db.cardinality/one
|
||||||
|
:db/unique :db.unique/identity}]]}
|
||||||
:add-expected-depsoit-link {:txes [[{:db/ident :expected-deposit/charges
|
:add-expected-depsoit-link {:txes [[{:db/ident :expected-deposit/charges
|
||||||
:db/doc "charges for the deposit"
|
:db/doc "charges for the deposit"
|
||||||
:db/valueType :db.type/ref
|
:db/valueType :db.type/ref
|
||||||
|
|||||||
@@ -178,8 +178,8 @@
|
|||||||
(remove-nils
|
(remove-nils
|
||||||
#:charge
|
#:charge
|
||||||
{:type-name (:type t)
|
{:type-name (:type t)
|
||||||
:external-id (when (:payment_id t)
|
:external-id (when (:id t)
|
||||||
(str "square/charge/" (:payment_id t)))
|
(str "square/charge/" (:id t)))
|
||||||
:processor (condp = (some-> (:note t) str/lower-case)
|
:processor (condp = (some-> (:note t) str/lower-case)
|
||||||
"doordash" :ccp-processor/doordash
|
"doordash" :ccp-processor/doordash
|
||||||
"dd" :ccp-processor/doordash
|
"dd" :ccp-processor/doordash
|
||||||
@@ -196,16 +196,17 @@
|
|||||||
:total (amount->money (:amount_money t))
|
:total (amount->money (:amount_money t))
|
||||||
:tip (amount->money (:tip_money t))}))))
|
:tip (amount->money (:tip_money t))}))))
|
||||||
:line-items (->> (:line_items order)
|
:line-items (->> (:line_items order)
|
||||||
(map (fn [li]
|
(map-indexed (fn [i li]
|
||||||
(remove-nils
|
(remove-nils
|
||||||
#:order-line-item
|
#:order-line-item
|
||||||
{:item-name (:name li)
|
{:external-id (str "square/order/" (:client/code client) "-" (:square-location/client-location location) "-" (:id order) "-" i)
|
||||||
:category (if (= "GIFT_CARD" (:item_type li))
|
:item-name (:name li)
|
||||||
"Gift Card"
|
:category (if (= "GIFT_CARD" (:item_type li))
|
||||||
(item-id->category-name client (:catalog_object_id li)))
|
"Gift Card"
|
||||||
:total (amount->money (:total_money li))
|
(item-id->category-name client (:catalog_object_id li)))
|
||||||
:tax (amount->money (:total_tax_money li))
|
:total (amount->money (:total_money li))
|
||||||
:discount (amount->money (:total_discount_money li))}))))}))
|
:tax (amount->money (:total_tax_money li))
|
||||||
|
:discount (amount->money (:total_discount_money li))}))))}))
|
||||||
|
|
||||||
(defn daily-results
|
(defn daily-results
|
||||||
([client location]
|
([client location]
|
||||||
|
|||||||
Reference in New Issue
Block a user