diff --git a/src/components/orders/OrderDetailPanel.jsx b/src/components/orders/OrderDetailPanel.jsx index 270e19c..d4d7602 100644 --- a/src/components/orders/OrderDetailPanel.jsx +++ b/src/components/orders/OrderDetailPanel.jsx @@ -61,12 +61,25 @@ const parseOrderList = (order) => { } // Fallback: sourceOrders (1C exchange data) + // Collect orderList from ALL source orders, not just the first one if (order.sourceOrders) { let parsed = order.sourceOrders; if (typeof parsed === 'string') { try { parsed = JSON.parse(parsed); } catch { /* ignore */ } } if (Array.isArray(parsed) && parsed.length > 0) { + const allItems = []; + for (const src of parsed) { + if (src && Array.isArray(src.orderList)) { + for (const ol of src.orderList) { + if (ol && (ol.items || ol.nom || ol.name)) { + allItems.push(ol); + } + } + } + } + if (allItems.length > 0) return allItems; + // Legacy: return whole array if no orderList structure if (parsed[0].orderList && Array.isArray(parsed[0].orderList)) { return parsed[0].orderList; }