feat: [shipment] 출고 프로세스 개선

- 생산완료 시 출하 자동생성 status를 ready(출하대기)로 변경
- stats에 completed_count 등 프론트 호환 필드 추가
- 절곡물/모터/부자재 수량을 개수(EA) 기반으로 변환
This commit is contained in:
2026-03-18 09:22:23 +09:00
parent bba8f6c0a0
commit 3259a64beb
2 changed files with 5 additions and 2 deletions

View File

@@ -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, // 생산 완료 후 생성되므로 출하가능