feat: 견적확정 밸리데이션, 작업지시 통계 공정별 카운트, 입고/재고 개선
- 견적확정 시 업체명/현장명/담당자/연락처 필수 검증 추가 (QuoteService) - 작업지시 stats API에 by_process 공정별 카운트 반환 추가 - 작업지시 목록/상세 쿼리에 수주 개소(rootNodes) 연관 로딩 - 작업지시 품목에 sourceOrderItem.node 관계 추가 - 입고관리 완료건 수정 허용 및 재고 차이 조정 - work_order_step_progress 테이블 마이그레이션 - receivings 테이블 options 컬럼 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -526,6 +526,26 @@ public function finalize(int $id): Quote
|
||||
throw new BadRequestHttpException(__('error.quote_not_finalizable'));
|
||||
}
|
||||
|
||||
// 확정 시 필수 필드 검증 (업체명, 현장명, 담당자, 연락처)
|
||||
$missing = [];
|
||||
if (empty($quote->client_name)) {
|
||||
$missing[] = '업체명';
|
||||
}
|
||||
if (empty($quote->site_name)) {
|
||||
$missing[] = '현장명';
|
||||
}
|
||||
if (empty($quote->manager)) {
|
||||
$missing[] = '담당자';
|
||||
}
|
||||
if (empty($quote->contact)) {
|
||||
$missing[] = '연락처';
|
||||
}
|
||||
if (! empty($missing)) {
|
||||
throw new BadRequestHttpException(
|
||||
__('error.quote_finalize_missing_fields', ['fields' => implode(', ', $missing)])
|
||||
);
|
||||
}
|
||||
|
||||
$quote->update([
|
||||
'status' => Quote::STATUS_FINALIZED,
|
||||
'is_final' => true,
|
||||
|
||||
Reference in New Issue
Block a user