fix: [approval] 문서번호 생성 시 삭제된 문서도 포함하여 중복 방지
- generateDocumentNumber()에서 query() → withTrashed()로 변경 - soft-deleted 결재문서 번호와의 충돌 방지 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1536,7 +1536,7 @@ private function generateDocumentNumber(int $tenantId): string
|
||||
$prefix = 'AP';
|
||||
$date = now()->format('Ymd');
|
||||
|
||||
$lastNumber = Approval::query()
|
||||
$lastNumber = Approval::withTrashed()
|
||||
->where('tenant_id', $tenantId)
|
||||
->where('document_number', 'like', "{$prefix}-{$date}-%")
|
||||
->orderByDesc('document_number')
|
||||
|
||||
Reference in New Issue
Block a user