updates to prevent in-progress orders
This commit is contained in:
@@ -100,8 +100,7 @@
|
||||
|
||||
|
||||
|
||||
}
|
||||
"state_filter" {"states" ["COMPLETED"]}}
|
||||
}}
|
||||
|
||||
"sort" {
|
||||
"sort_field" "CREATED_AT"
|
||||
@@ -235,7 +234,9 @@
|
||||
(filter location_id->client-location)
|
||||
(mapcat #(search % d))
|
||||
(filter (fn [order]
|
||||
(and (= "COMPLETED" (:state order))
|
||||
;; sometimes orders stay open in square. At least one payment
|
||||
;; is needed to import, in order to avoid importing orders in-progress.
|
||||
(and (> (count (:tenders order)) 0)
|
||||
(not= #{"FAILED"}
|
||||
(set (map #(:status (:card_details %)) (:tenders order)))))))
|
||||
(map order->sales-order)))
|
||||
@@ -488,7 +489,9 @@
|
||||
(comment
|
||||
(daily-results)
|
||||
(mount/stop (mount/only #{'auto-ap.square.core/square-settlement-loader}))
|
||||
|
||||
(mount/stop (mount/only #{'auto-ap.square.core/square-refund-loader}))
|
||||
|
||||
(mount/stop (mount/only #{'auto-ap.square.core/square-loader}))
|
||||
|
||||
(mount/start (mount/only #{'auto-ap.square.core/square-settlement-loader}))
|
||||
|
||||
Reference in New Issue
Block a user