 "note_length": 0
}
✅ [ODOO VERIFY] Order #2940 PO aktualizacji: {
  "x_studio_status_w_oms": "Nowe",
  "x_studio_patnosc_w_oms": "PAID",
  "x_studio_numer_w_oms": "31",
  "client_order_ref": "#31",
  "date_order": "2025-10-12 14:22:46",
  "state": "sale"
}
✅ Updated Odoo sale order 2940
✅ Przywrócono oryginalną datę zamówienia: 2025-10-12 14:22:46
✅ Synced #31 to Odoo (order #2940) in 2562ms
🔍 DEBUG orderDate for #32: { value: '2025-10-12 16:24:13', type: 'string', isDate: false }
❌ Error logging order change: Error: Query read timeout
    at /home/runner/workspace/node_modules/pg/lib/client.js:545:17
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async logOrderChange (/home/runner/workspace/server/postgres.ts:1714:5)
    at async saveOrderToCommerce (/home/runner/workspace/server/postgres.ts:1330:13)
    at async syncShoperOrders (/home/runner/workspace/server/routes.ts:773:24)
   📝 buyer_address: "Psienie Ostrów 4" → "Psienie Ostrów 4, 63-304 Czermin"
👤 Found existing partner: Artur Rapacz (ID: 2107)
📦 Found existing product by name: Szafka na buty Supra 50x30 Szafa z szufladą D1N1 OLEJOWANY (ID: 22)
🔍 [DEBUG orderDate] #32: {
  value: '2025-10-12 16:24:13',
  type: 'string',
  isNull: false,
  isUndefined: false,
  isFalsy: false
}
📅 [ODOO DATE] #32: 2025-10-12 16:24:13 ✅ (from order_date)
🔗 [ODOO URL] Generuję URL dla #32: https://fae6c547-312f-4ca2-b2c2-9d60287fe4cd-00-9u0p969nwges.worf.replit.dev/order/32
🔍 [ODOO CREATE] Wysyłam do Odoo: {
  "order_number": 32,
  "date_order": "2025-10-12 16:24:13",
  "partner_id": 2107,
  "amount_total": 788
}
✅ Created Odoo sale order 2941 for #32
🔍 [ODOO RESPONSE] Odoo zapisało: {
  "odoo_id": 2941,
  "date_order": "2025-10-12 16:24:13",
  "create_date": "2025-10-12 20:41:42"
}
✅ Confirmed Odoo sale order 2941 (changed from quotation to sale order)
🔍 [ODOO UPDATE] Wysyłam do Odoo order #2941: {
  "date_order": "2025-10-12 16:24:13",
  "note_length": 0
}
✅ [ODOO VERIFY] Order #2941 PO aktualizacji: {
  "x_studio_status_w_oms": "Nowe",
  "x_studio_patnosc_w_oms": "PENDING",
  "x_studio_numer_w_oms": "32",
  "client_order_ref": "#32",
  "date_order": "2025-10-12 16:24:13",
  "state": "sale"
}
✅ Updated Odoo sale order 2941
✅ Przywrócono oryginalną datę zamówienia: 2025-10-12 16:24:13
✅ Synced #32 to Odoo (order #2941) in 2647ms
🔍 DEBUG orderDate for #33: { value: '2025-10-12 14:37:07', type: 'string', isDate: false }
🔗 [ODOO URL UPDATE] Generuję URL dla #33: https://fae6c547-312f-4ca2-b2c2-9d60287fe4cd-00-9u0p969nwges.worf.replit.dev/order/33
📅 [ODOO UPDATE] #33: date_order=2025-10-12 14:37:07
🔍 [ODOO UPDATE] Wysyłam do Odoo order #2904: {
  "x_studio_status_w_oms": "Nowe",
  "x_studio_patnosc_w_oms": "PAID",
  "x_studio_numer_w_oms": 33,
  "client_order_ref": "#33",
  "date_order": "2025-10-12 14:37:07",
  "note_length": 50
}
🔄 Zamówienie #33 usunięte z Odoo - zmieniam na CREATE
🔓 Zwolniono blokadę processSyncQueue()
📊 Odoo sync: 3 succeeded, 1 failed out of 4 processed
🔧 syncRecentOrdersToOdoo completed
🔧 Scheduled Odoo sync completed
❌ Error logging order change: Error: Query read timeout
    at /home/runner/workspace/node_modules/pg/lib/client.js:545:17
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async logOrderChange (/home/runner/workspace/server/postgres.ts:1699:30)
    at async saveOrderToCommerce (/home/runner/workspace/server/postgres.ts:1330:13)
    at async syncShoperOrders (/home/runner/workspace/server/routes.ts:773:24)
🔍 DEBUG - UPDATE parameter (payment_amount) for SHOPER-23208:
   payment.paidAmount = {"amount":780,"currency":"PLN"}
   payment.paidAmount?.amount = 780
   orderData.sum = 780.00
   Final value (payment.paidAmount?.amount ?? orderData.sum) = 780
🔄 Aktualizuję istniejące zamówienie SHOPER-23208
🔍 DEBUG - RETURNING after INSERT/UPDATE for SHOPER-23208:
   returned_payment_amount = 780.00
✅ Order 23208 saved to commerce.orders (SHOPER)
✅ Dodano #49 do kolejki Odoo (update)
✅ Saved Shoper order 23208 to commerce.orders and shoper.orders (0 parcels)
✅ Successfully synced Shoper orders: 0 new, 1 updated, 0 failed out of 1 total
8:42:25 PM [express] GET /api/orders/today-stats 200 in 377ms :: {"revenueToday":31015.92,"paidToday…
8:42:25 PM [express] GET /api/orders/statistics 200 in 380ms :: {"totalOrders":58,"paidOrders":52,"u…
8:42:25 PM [express] GET /api/sync/status 200 in 385ms :: {"lastSyncAt":"2025-10-12T20:42:02.035Z","…
8:42:30 PM [express] GET /api/orders/today-stats 304 in 147ms :: {"revenueToday":31015.92,"paidToday…
8:42:31 PM [express] GET /api/orders/statistics 304 in 150ms :: {"totalOrders":58,"paidOrders":52,"u…
8:42:31 PM [express] GET /api/sync/status 304 in 145ms :: {"lastSyncAt":"2025-10-12T20:42:02.035Z","…
Running scheduled sync...
Running scheduled Shoper sync...
🛒 Starting Shoper orders sync...
Running scheduled Odoo sync...
🔧 Imported Odoo sync functions
🔄 Found 5 orders updated in last 1 minutes for Odoo sync
📦 Incremental sync - fetching Allegro orders updated after 2025-10-12T20:42:02.035Z
🔧 processSyncQueue() started
🔍 DEBUG createOdooClient: Original URL = "https://alpma.app"
🔍 DEBUG createOdooClient: includes tunnel.pyjam.as = false
🔍 DEBUG createOdooClient: Final URL = "https://alpma.app"
🔧 createOdooClient() returned: OdooClient instance
🔓 Zdobyto blokadę processSyncQueue()
📦 Incremental: fetched 0 orders (offset: 0, total: 0)
🔓 Zwolniono blokadę processSyncQueue()
🔧 syncRecentOrdersToOdoo completed
🔧 Scheduled Odoo sync completed
Successfully synced 0 orders from Allegro (0 new, 0 updated)
📥 Shoper API returned 18 payment methods total
📋 Loaded 18 payment methods and 8 delivery methods
💳 Payment methods: [
  [ '1', 'Gotówka' ],
  [ '2', 'Pobranie' ],
  [ '3', 'Autopay' ],
  [ '4', 'mBank mRaty' ],
  [ '5', 'PayU' ],
  [ '6', 'DotPay' ],
  [ '7', 'Przelewy24.pl' ],
  [ '10', 'eRaty Santander Consumer Bank S.A.' ],
  [ '11', 'PayPal' ],
  [ '12', 'Allegro' ],
  [ '13', 'Darmowe zamówienie' ],
  [ '14', 'PayPal Express Checkout' ],
  [ '15', 'Klarna (Sofort)' ],
  [ '16', 'Braintree' ],
  [ '17', 'Klarna "Zapłać za 30 dni"' ],
  [ '18', 'Przelewy24' ],
  [ '19', 'InPost Pay' ],
  [ '20', 'Stripe' ]