Plaid enabled for staging
This commit is contained in:
@@ -205,5 +205,17 @@
|
||||
{:db/ident :transaction/expected-deposit
|
||||
:db/doc "If this transaction is a deposit, the deposit that we anticipated"
|
||||
:db/valueType :db.type/ref
|
||||
:db/cardinality :db.cardinality/one}]]}})
|
||||
:db/cardinality :db.cardinality/one}]]}
|
||||
:add-vendor-for-sales-stuff {:txes [[{:db/ident :expected-deposit/vendor
|
||||
:db/doc "Which vendor is this deposit for? CCP Square?"
|
||||
:db/valueType :db.type/ref
|
||||
:db/cardinality :db.cardinality/one}
|
||||
{:db/ident :sales-order/vendor
|
||||
:db/doc "Which vendor is this sales-order for? CCP Square?"
|
||||
:db/valueType :db.type/ref
|
||||
:db/cardinality :db.cardinality/one}
|
||||
{:db/ident :sales-refund/vendor
|
||||
:db/doc "Which vendor is this refund for? CCP Square?"
|
||||
:db/valueType :db.type/ref
|
||||
:db/cardinality :db.cardinality/one}]]}})
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
:transaction-account/amount amount
|
||||
:transaction-account/location "A"}]
|
||||
:transaction/approval-status :transaction-approval-status/approved
|
||||
:transaction/vendor :vendor/ccp-square
|
||||
:transaction/vendor (:expected-deposit/vendor expected-deposit)
|
||||
))))
|
||||
|
||||
(defn maybe-code [{:transaction/keys [client amount] :as transaction} apply-rules valid-locations]
|
||||
|
||||
@@ -165,6 +165,7 @@
|
||||
:client [:client/code client]
|
||||
:location location
|
||||
:external-id (str "square/order/" client "-" location "-" (:id order))
|
||||
:vendor :vendor/ccp-square
|
||||
:total (-> order :net_amounts :total_money amount->money)
|
||||
:tax (-> order :net_amounts :tax_money amount->money)
|
||||
:tip (-> order :net_amounts :tip_money amount->money)
|
||||
@@ -332,6 +333,7 @@
|
||||
([client location-id]
|
||||
(->> (for [settlement (settlements client location-id)]
|
||||
#:expected-deposit {:external-id (str "square/settlement/" (:id settlement))
|
||||
:vendor :vendor/ccp-square
|
||||
:total (amount->money (:total_money settlement))
|
||||
:client [:client/code client]
|
||||
:location (get-in env [:square-config client :location])
|
||||
@@ -362,6 +364,7 @@
|
||||
(filter (fn [r] (= "COMPLETED" (:status r))))
|
||||
(map (fn [r]
|
||||
#:sales-refund {:external-id (str "square/refund/" (:id r))
|
||||
:vendor :vendor/ccp-square
|
||||
:total (amount->money (:amount_money r))
|
||||
:fee (transduce
|
||||
(comp (filter #(= "ADJUSTMENT" (:type %)))
|
||||
|
||||
Reference in New Issue
Block a user