diff --git a/src/Repository/AssignmentRepository.php b/src/Repository/AssignmentRepository.php index d0a7197..2983fdd 100644 --- a/src/Repository/AssignmentRepository.php +++ b/src/Repository/AssignmentRepository.php @@ -55,10 +55,20 @@ class AssignmentRepository extends ServiceEntityRepository ->select('assignment', 'destination', 'job_profile', 'application', 'disposition') ->innerJoin('assignment.destination', 'destination') ->innerJoin('assignment.jobProfile', 'job_profile') - ->where($qb->expr()->isNull('assignment.deletedAt')) + ->where($qb->expr()->andX( + $qb->expr()->orX( + $qb->expr()->gt('destination.dateFrom', ':now'), + $qb->expr()->andX( + $qb->expr()->isNotNull('assignment.dateFrom'), + $qb->expr()->gt('assignment.dateFrom', ':now') + ) + ), + $qb->expr()->isNull('assignment.deletedAt') + )) ->leftJoin('assignment.applications', 'application', Join::WITH, $qb->expr()->eq('application.teamer', ':teamer')) ->leftJoin('assignment.dispositions', 'disposition', Join::WITH, $qb->expr()->eq('disposition.teamer', ':teamer')) ->setParameter('teamer', $teamer) + ->setParameter('now', new \DateTimeImmutable()) ; $this->applyFilterSettings($filterDto, $qb);