feat(sync): handle cancelled GoMag orders (status Anulata / statusId 7)
- Add web_status column to orders table (generic name for platform status) - Filter cancelled orders during sync, record as CANCELLED in SQLite - Soft-delete previously-imported cancelled orders in Oracle (if not invoiced) - Add CANCELLED filter pill + badge in dashboard UI - New soft_delete_order_in_roa() and mark_order_cancelled() functions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -109,7 +109,8 @@ CREATE TABLE IF NOT EXISTS orders (
|
||||
invoice_checked_at TEXT,
|
||||
order_total REAL,
|
||||
delivery_cost REAL,
|
||||
discount_total REAL
|
||||
discount_total REAL,
|
||||
web_status TEXT
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_orders_status ON orders(status);
|
||||
CREATE INDEX IF NOT EXISTS idx_orders_date ON orders(order_date);
|
||||
@@ -316,6 +317,7 @@ def init_sqlite():
|
||||
("order_total", "REAL"),
|
||||
("delivery_cost", "REAL"),
|
||||
("discount_total", "REAL"),
|
||||
("web_status", "TEXT"),
|
||||
]:
|
||||
if col not in order_cols:
|
||||
conn.execute(f"ALTER TABLE orders ADD COLUMN {col} {typedef}")
|
||||
|
||||
Reference in New Issue
Block a user