fix(WEB): 입고관리 저장 오류 3건 수정

- FormRequest에 manufacturer, material_no 규칙 추가 (validated()에서 누락 방지)
- store() 시 lot_no 자동 생성 (generateLotNo() 폴백)
- getOrCreateStock()에서 item_code 기반 2차 검색 추가 (unique key 충돌 방지)
  - 동일 item_code, 다른 item_id인 Stock 존재 시 item_id 업데이트
  - SoftDeletes 복원 로직 포함

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 03:50:24 +09:00
parent 16b8dbcc6f
commit 7eb5825d41
4 changed files with 32 additions and 5 deletions

View File

@@ -199,7 +199,7 @@ public function store(array $data): Receiving
$receiving->due_date = $data['due_date'] ?? null;
$receiving->receiving_qty = $data['receiving_qty'] ?? null;
$receiving->receiving_date = $data['receiving_date'] ?? null;
$receiving->lot_no = $data['lot_no'] ?? null;
$receiving->lot_no = $data['lot_no'] ?? $this->generateLotNo();
$receiving->status = $data['status'] ?? 'receiving_pending';
$receiving->remark = $data['remark'] ?? null;