diff --git a/app/Services/ShipmentService.php b/app/Services/ShipmentService.php index 89cd4198..ee58a073 100644 --- a/app/Services/ShipmentService.php +++ b/app/Services/ShipmentService.php @@ -122,8 +122,11 @@ public function stats(): array // 프론트엔드 호환 필드 (snake_case) 'today_shipment_count' => $todayScheduled, 'scheduled_count' => $scheduled, + 'ready_count' => $ready, 'shipping_count' => $shipping, + 'completed_count' => $completed, 'urgent_count' => $urgent, + 'total_count' => $total, ]; } diff --git a/app/Services/WorkOrderService.php b/app/Services/WorkOrderService.php index 2fc5f014..31494b21 100644 --- a/app/Services/WorkOrderService.php +++ b/app/Services/WorkOrderService.php @@ -742,7 +742,7 @@ private function createShipmentFromOrder(Order $order, $mainWorkOrders, int $ten 'work_order_id' => null, // 수주 단위이므로 개별 WO 연결 안함 'order_id' => $order->id, 'scheduled_date' => $order->delivery_date ?? now()->toDateString(), - 'status' => 'scheduled', + 'status' => 'ready', 'priority' => 'normal', 'delivery_method' => $order->delivery_method_code ?? 'pickup', 'can_ship' => true, @@ -847,7 +847,7 @@ private function createShipmentFromWorkOrder(WorkOrder $workOrder, int $tenantId 'work_order_id' => $workOrder->id, 'order_id' => $workOrder->sales_order_id, 'scheduled_date' => now()->toDateString(), // 오늘 날짜로 출하 예정 - 'status' => 'scheduled', // 예정 상태로 생성 + 'status' => 'ready', // 생산 완료 → 출하대기 'priority' => 'normal', 'delivery_method' => 'pickup', // 기본값 'can_ship' => true, // 생산 완료 후 생성되므로 출하가능