From 3259a64bebf8a4420a2d827decb9c97a1edaad90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Wed, 18 Mar 2026 09:22:23 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[shipment]=20=EC=B6=9C=EA=B3=A0=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=EC=84=B8=EC=8A=A4=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 생산완료 시 출하 자동생성 status를 ready(출하대기)로 변경 - stats에 completed_count 등 프론트 호환 필드 추가 - 절곡물/모터/부자재 수량을 개수(EA) 기반으로 변환 --- app/Services/ShipmentService.php | 3 +++ app/Services/WorkOrderService.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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, // 생산 완료 후 생성되므로 출하가능