added basics of ccp processor visibility.
This commit is contained in:
@@ -341,10 +341,7 @@
|
|||||||
ledger/norms-map
|
ledger/norms-map
|
||||||
yodlee2/norms-map
|
yodlee2/norms-map
|
||||||
audit/norms-map
|
audit/norms-map
|
||||||
|
vendors/norms-map)]
|
||||||
vendors/norms-map
|
|
||||||
)
|
|
||||||
]
|
|
||||||
(println "Conforming database...")
|
(println "Conforming database...")
|
||||||
(c/ensure-conforms conn norms-map)
|
(c/ensure-conforms conn norms-map)
|
||||||
#_(when (not (seq args))
|
#_(when (not (seq args))
|
||||||
|
|||||||
@@ -92,6 +92,7 @@
|
|||||||
:db/cardinality :db.cardinality/one}
|
:db/cardinality :db.cardinality/one}
|
||||||
|
|
||||||
]]}
|
]]}
|
||||||
|
|
||||||
:add-expected-deposits {:txes [[{:db/ident :expected-deposit/external-id
|
:add-expected-deposits {:txes [[{:db/ident :expected-deposit/external-id
|
||||||
:db/doc "The external id for the deposit"
|
:db/doc "The external id for the deposit"
|
||||||
:db/valueType :db.type/string
|
:db/valueType :db.type/string
|
||||||
@@ -123,6 +124,7 @@
|
|||||||
:db/valueType :db.type/double
|
:db/valueType :db.type/double
|
||||||
:db/cardinality :db.cardinality/one}]]}
|
:db/cardinality :db.cardinality/one}]]}
|
||||||
|
|
||||||
|
|
||||||
:add-discounts {:txes [[{:db/ident :sales-order/discount
|
:add-discounts {:txes [[{:db/ident :sales-order/discount
|
||||||
:db/doc "The total amount on the sale"
|
:db/doc "The total amount on the sale"
|
||||||
:db/valueType :db.type/double
|
:db/valueType :db.type/double
|
||||||
@@ -145,7 +147,21 @@
|
|||||||
{:db/ident :sales-order/service-charge
|
{:db/ident :sales-order/service-charge
|
||||||
:db/doc "The total cost on the item"
|
:db/doc "The total cost on the item"
|
||||||
:db/valueType :db.type/double
|
:db/valueType :db.type/double
|
||||||
:db/cardinality :db.cardinality/one}]]}})
|
:db/cardinality :db.cardinality/one}]]}
|
||||||
|
|
||||||
|
:add-food-apps {:txes [[{:db/ident :ccp-processor/doordash
|
||||||
|
:db/doc "Doordash identifier"}
|
||||||
|
{:db/ident :ccp-processor/grubhub
|
||||||
|
:db/doc "Grubhub identifier"}
|
||||||
|
{:db/ident :ccp-processor/uber-eats
|
||||||
|
:db/doc "Uber eats processor"}
|
||||||
|
{:db/ident :ccp-processor/na
|
||||||
|
:db/doc "No specific ccp processor"}
|
||||||
|
|
||||||
|
{:db/ident :charge/processor
|
||||||
|
:db/doc "Which food app processed this order"
|
||||||
|
:db/valueType :db.type/ref
|
||||||
|
:db/cardinality :db.cardinality/one}]]}})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,15 @@
|
|||||||
|
|
||||||
(defn <-datomic [result]
|
(defn <-datomic [result]
|
||||||
(-> result
|
(-> result
|
||||||
(update :sales-order/date c/from-date)))
|
(update :sales-order/date c/from-date)
|
||||||
|
(update :sales-order/charges (fn [cs]
|
||||||
|
(map (fn [c]
|
||||||
|
(update c :charge/processor :db/ident))
|
||||||
|
cs)))))
|
||||||
|
|
||||||
(def default-read '[*
|
(def default-read '[*
|
||||||
{:sales-order/client [:client/name :db/id :client/code]}])
|
{:sales-order/client [:client/name :db/id :client/code]
|
||||||
|
:sales-order/charges [* {:charge/processor [:db/ident]}]}])
|
||||||
|
|
||||||
(defn raw-graphql-ids [db args]
|
(defn raw-graphql-ids [db args]
|
||||||
(let [query (cond-> {:query {:find []
|
(let [query (cond-> {:query {:find []
|
||||||
|
|||||||
@@ -262,6 +262,7 @@
|
|||||||
:discount {:type :money}}}
|
:discount {:type :money}}}
|
||||||
:charge
|
:charge
|
||||||
{:fields {:id {:type :id}
|
{:fields {:id {:type :id}
|
||||||
|
:processor {:type :processor}
|
||||||
:type_name {:type 'String}
|
:type_name {:type 'String}
|
||||||
:total {:type :money}
|
:total {:type :money}
|
||||||
:tip {:type :money}}}
|
:tip {:type :money}}}
|
||||||
@@ -908,6 +909,11 @@
|
|||||||
:enums {:payment_type {:values [{:enum-value :check}
|
:enums {:payment_type {:values [{:enum-value :check}
|
||||||
{:enum-value :cash}
|
{:enum-value :cash}
|
||||||
{:enum-value :debit}]}
|
{:enum-value :debit}]}
|
||||||
|
|
||||||
|
:processor {:values [{:enum-value :na}
|
||||||
|
{:enum-value :doordash}
|
||||||
|
{:enum-value :uber_eats}
|
||||||
|
{:enum-value :grubhub}]}
|
||||||
:tin_type {:values [{:enum-value :ein}
|
:tin_type {:values [{:enum-value :ein}
|
||||||
{:enum-value :ssn}]}
|
{:enum-value :ssn}]}
|
||||||
:type_1099 {:values [{:enum-value :none}
|
:type_1099 {:values [{:enum-value :none}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@
|
|||||||
|
|
||||||
(defn location_id->client-location [location]
|
(defn location_id->client-location [location]
|
||||||
({"2RVBYER6QSV7W" ["NGAK" "MH"]
|
({"2RVBYER6QSV7W" ["NGAK" "MH"]
|
||||||
"8JT71V8XGYAT3" ["NGKG" "NB"]
|
#_#_#_#_#_#_#_#_#_#_#_#_"8JT71V8XGYAT3" ["NGKG" "NB"]
|
||||||
"SCX0Y8CTGM1S0" ["NGE1" "UC"]
|
"SCX0Y8CTGM1S0" ["NGE1" "UC"]
|
||||||
"FNH5VRT890WK8" ["NGMJ" "SC"]
|
"FNH5VRT890WK8" ["NGMJ" "SC"]
|
||||||
"AMQ0NPA8FGDEF" ["NGPG" "SZ"]
|
"AMQ0NPA8FGDEF" ["NGPG" "SZ"]
|
||||||
@@ -175,6 +175,11 @@
|
|||||||
(remove-nils
|
(remove-nils
|
||||||
#:charge
|
#:charge
|
||||||
{:type-name (:type t)
|
{:type-name (:type t)
|
||||||
|
:processor (condp = (:note t)
|
||||||
|
"DOORDASH" :ccp-processor/doordash
|
||||||
|
"UBEREATS" :ccp-processor/uber-eats
|
||||||
|
"GRUBHUB" :ccp-processor/grubhub
|
||||||
|
:ccp-processor/na)
|
||||||
: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)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
:date-range (:date-range params)
|
:date-range (:date-range params)
|
||||||
:client-id (:id @(re-frame/subscribe [::subs/client]))}
|
:client-id (:id @(re-frame/subscribe [::subs/client]))}
|
||||||
[[:sales-orders [:id :total :tax :tip :discount :service-charge :returns :date
|
[[:sales-orders [:id :total :tax :tip :discount :service-charge :returns :date
|
||||||
[:charges [:type-name :total]]
|
[:charges [:type-name :total :processor]]
|
||||||
[:line-items [:item-name :total :category]]
|
[:line-items [:item-name :total :category]]
|
||||||
[:client [:name :id]]]]
|
[:client [:name :id]]]]
|
||||||
:total
|
:total
|
||||||
|
|||||||
@@ -17,7 +17,8 @@
|
|||||||
[grid/cell {:class "has-text-right"} (nf total )]
|
[grid/cell {:class "has-text-right"} (nf total )]
|
||||||
[grid/cell {:class "has-text-right"} (nf tax )]
|
[grid/cell {:class "has-text-right"} (nf tax )]
|
||||||
[grid/cell {:class "has-text-right"} (nf tip )]
|
[grid/cell {:class "has-text-right"} (nf tip )]
|
||||||
[grid/cell {} (str/join ", " (map :type-name charges))]
|
[grid/cell {} (str/join ", " (map (fn [c]
|
||||||
|
(str (:type-name c) " (" (name (:processor c)) ")")) charges))]
|
||||||
[grid/cell {} (str/join ", " (map :item-name line-items))]
|
[grid/cell {} (str/join ", " (map :item-name line-items))]
|
||||||
[grid/button-cell {}
|
[grid/button-cell {}
|
||||||
[:div.buttons
|
[:div.buttons
|
||||||
|
|||||||
Reference in New Issue
Block a user