From 55270198d495099fd2780d3cc91201a09442e05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Thu, 19 Feb 2026 16:55:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B2=AC=EC=A0=81=E2=86=92=EC=88=98?= =?UTF-8?q?=EC=A3=BC=20=EB=B3=80=ED=99=98=20=EC=8B=9C=20=EB=8B=B4=EB=8B=B9?= =?UTF-8?q?=EC=9E=90=20=EC=A0=95=EB=B3=B4=20=EB=88=84=EB=9D=BD=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Order::createFromQuote() 잘못된 필드명 수정 (contact_person→contact, delivery_date→completion_date) - 견적 담당자(manager)를 orders.options.manager_name에 저장 - StoreOrderRequest/UpdateOrderRequest에 options.manager_name 유효성 검증 추가 - WorkOrderService show()에서 salesOrder.options 컬럼 포함하여 담당자 표시 Co-Authored-By: Claude Opus 4.6 --- app/Http/Requests/Order/StoreOrderRequest.php | 1 + app/Http/Requests/Order/UpdateOrderRequest.php | 1 + app/Models/Orders/Order.php | 8 +++++--- app/Services/WorkOrderService.php | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Http/Requests/Order/StoreOrderRequest.php b/app/Http/Requests/Order/StoreOrderRequest.php index dbe67ff..aed252d 100644 --- a/app/Http/Requests/Order/StoreOrderRequest.php +++ b/app/Http/Requests/Order/StoreOrderRequest.php @@ -54,6 +54,7 @@ public function rules(): array 'options.receiver_contact' => 'nullable|string|max:100', 'options.shipping_address' => 'nullable|string|max:500', 'options.shipping_address_detail' => 'nullable|string|max:500', + 'options.manager_name' => 'nullable|string|max:100', // 품목 배열 'items' => 'nullable|array', diff --git a/app/Http/Requests/Order/UpdateOrderRequest.php b/app/Http/Requests/Order/UpdateOrderRequest.php index a865312..59a2518 100644 --- a/app/Http/Requests/Order/UpdateOrderRequest.php +++ b/app/Http/Requests/Order/UpdateOrderRequest.php @@ -48,6 +48,7 @@ public function rules(): array 'options.receiver_contact' => 'nullable|string|max:100', 'options.shipping_address' => 'nullable|string|max:500', 'options.shipping_address_detail' => 'nullable|string|max:500', + 'options.manager_name' => 'nullable|string|max:100', // 품목 배열 (전체 교체) 'items' => 'nullable|array', diff --git a/app/Models/Orders/Order.php b/app/Models/Orders/Order.php index 647ea4b..426aece 100644 --- a/app/Models/Orders/Order.php +++ b/app/Models/Orders/Order.php @@ -325,15 +325,17 @@ public static function createFromQuote(Quote $quote, string $orderNo): self 'status_code' => self::STATUS_DRAFT, 'client_id' => $quote->client_id, 'client_name' => $quote->client?->name, - 'client_contact' => $quote->contact_person, + 'client_contact' => $quote->contact, 'site_name' => $quote->site_name, 'quantity' => $quote->items->sum('calculated_quantity'), 'supply_amount' => $quote->total_amount, 'tax_amount' => round($quote->total_amount * 0.1, 2), 'total_amount' => round($quote->total_amount * 1.1, 2), - 'delivery_date' => $quote->delivery_date, + 'delivery_date' => $quote->completion_date, 'memo' => $quote->remarks, - 'remarks' => $quote->internal_notes, + 'options' => [ + 'manager_name' => $quote->manager, + ], ]); } } diff --git a/app/Services/WorkOrderService.php b/app/Services/WorkOrderService.php index 02b3a85..18e0f05 100644 --- a/app/Services/WorkOrderService.php +++ b/app/Services/WorkOrderService.php @@ -210,7 +210,7 @@ public function show(int $id) 'assignee:id,name', 'assignees.user:id,name', 'team:id,name', - 'salesOrder' => fn ($q) => $q->select('id', 'order_no', 'site_name', 'client_id', 'client_contact', 'received_at', 'writer_id', 'created_at', 'quantity')->withCount('rootNodes'), + 'salesOrder' => fn ($q) => $q->select('id', 'order_no', 'site_name', 'client_id', 'client_contact', 'received_at', 'writer_id', 'created_at', 'quantity', 'options')->withCount('rootNodes'), 'salesOrder.client:id,name', 'salesOrder.writer:id,name', 'process:id,process_name,process_code,work_steps,department,options',