fix: 견적→수주 변환 시 담당자 정보 누락 수정
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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,
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user