Adds square koala-production

This commit is contained in:
2021-12-06 17:32:20 -08:00
parent 0e49b9f493
commit b0fe873fef
3 changed files with 8 additions and 6 deletions

View File

@@ -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))))))

View File

@@ -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)

View File

@@ -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)