diff --git a/flows/sds/refresh_100_prefix.py b/flows/sds/refresh_100_prefix.py index b2b1705..23f9244 100644 --- a/flows/sds/refresh_100_prefix.py +++ b/flows/sds/refresh_100_prefix.py @@ -78,6 +78,8 @@ def upsert_records(remote_map: dict, target_order_nos: list[str]) -> dict: pass stats = SyncDB().sync_orders_and_goods(order_inputs, goods_inputs) + stats["orderCount"] = len(order_inputs) + stats["goodsCount"] = len(goods_inputs) stats["skippedStillPending"] = skipped_pending stats["skippedUnpaid"] = skipped_unpaid return stats diff --git a/flows/shared/db.py b/flows/shared/db.py index 354cd38..6d77e05 100644 --- a/flows/shared/db.py +++ b/flows/shared/db.py @@ -46,7 +46,7 @@ class SyncDB: with conn.cursor() as cur: cur.execute( 'SELECT DISTINCT "orderNo" FROM "Orders" WHERE "systemName"=%s ' - 'AND ("systemStatus" IS NULL OR "systemStatus" <> ALL %s)', + 'AND ("systemStatus" IS NULL OR "systemStatus" <> ALL(%s))', (system_name, exclude_statuses), ) rows = cur.fetchall()