Adds square koala-production
This commit is contained in:
@@ -106,10 +106,10 @@
|
||||
{:headers
|
||||
(with-auth prod-base-headers token)
|
||||
:as :json
|
||||
:query-params {"query" "SELECT * From Account"}}))
|
||||
:query-params {"query" "SELECT * From Account maxresults 1000"}}))
|
||||
:QueryResponse
|
||||
:Account
|
||||
(filter
|
||||
#_(filter
|
||||
#(#{"Bank" "Credit Card"} (:AccountType %)))
|
||||
(map (juxt :Id :Name))
|
||||
(map (fn [[id name]]
|
||||
@@ -118,6 +118,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
(defn get-transactions []
|
||||
(client/get (str prod-base-url "/company/" prod-company-id "/reports/TransactionList" "?minorversion=63&start_date=2021-11-30&end_date=2021-11-30")
|
||||
{:headers prod-base-headers
|
||||
@@ -139,7 +140,6 @@
|
||||
[(keyword h) (:value r)])
|
||||
headers
|
||||
row))))
|
||||
(filter #(= external-id
|
||||
(:Account %)))))))
|
||||
(filter #(str/includes? (:Account %) external-id))))))
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
db))
|
||||
:let [bank-account (d/entity db bank-account)
|
||||
end (auto-ap.time/local-now)
|
||||
start (time/plus end (time/days -10))]
|
||||
start (time/plus end (time/days -90))]
|
||||
]
|
||||
(log/infof "importing from %s to %s for %s" start end external-id)
|
||||
(let [transactions (->> (i/get-transactions (auto-ap.time/unparse start auto-ap.time/iso-date)
|
||||
|
||||
@@ -222,7 +222,9 @@
|
||||
(not= #{"FAILED"}
|
||||
(set (map #(:status (:card_details %)) (:tenders order)))))))
|
||||
(filter (fn [order]
|
||||
(not= "Koala" (:name (:source order)))))
|
||||
(and
|
||||
(not= "Koala" (:name (:source order)))
|
||||
(not= "Koala-production" (:name (:source order))))))
|
||||
(map #(order->sales-order client (get-in env [:square-config client :location]) %)))))
|
||||
|
||||
#_(daily-results)
|
||||
|
||||
Reference in New Issue
Block a user