commit compras2 2811
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-28 15:45:52 +02:00
parent eb32c74c56
commit 060c119ba1
92 changed files with 4936 additions and 43 deletions
+4
View File
@@ -24,6 +24,10 @@ class ConflictGuard
public function hasConflict(int $userId, ?int $supplierId, ?int $requisitionId): bool
{
return ConflictDeclaration::query()->where('user_id', $userId)->where('has_conflict', true)
->when(app(ConflictReleases::class)->ready(), fn ($query) => $query->whereNotExists(fn ($release) => $release
->selectRaw('1')->from('conflict_releases')
->whereColumn('conflict_releases.tenant_id', 'conflict_declarations.tenant_id')
->whereRaw('conflict_releases.root_id = COALESCE(conflict_declarations.root_id, conflict_declarations.id)')))
->where(function ($scopes) use ($supplierId, $requisitionId) {
// Supplier-wide statements apply only once that supplier is known.
$scopes->where(function ($supplierScope) use ($supplierId) {