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