fix: ignore called off and deleted assignments when sending reminders
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Service\Cron;
|
namespace App\Service\Cron;
|
||||||
|
|
||||||
use App\Email\Mailer;
|
use App\Email\Mailer;
|
||||||
|
use App\Entity\Assignment;
|
||||||
use App\Entity\Disposition;
|
use App\Entity\Disposition;
|
||||||
use App\Entity\Upload;
|
use App\Entity\Upload;
|
||||||
use App\Repository\DispositionRepository;
|
use App\Repository\DispositionRepository;
|
||||||
@@ -30,12 +31,14 @@ class DispositionReminderService
|
|||||||
->innerJoin('assignment.destination', 'destination')
|
->innerJoin('assignment.destination', 'destination')
|
||||||
->innerJoin('disposition.documents', 'document', Join::WITH, 'document.type = :documentType')
|
->innerJoin('disposition.documents', 'document', Join::WITH, 'document.type = :documentType')
|
||||||
->where($qb->expr()->andX(
|
->where($qb->expr()->andX(
|
||||||
|
$qb->expr()->notIn('assignment.status', ':statusAssignment'),
|
||||||
$qb->expr()->eq('destination.dateFrom', ':dateFrom'),
|
$qb->expr()->eq('destination.dateFrom', ':dateFrom'),
|
||||||
$qb->expr()->eq('document.status', ':status')
|
$qb->expr()->eq('document.status', ':statusContract'),
|
||||||
))
|
))
|
||||||
->setParameter('documentType', Upload::TYPE_CONTRACT)
|
->setParameter('documentType', Upload::TYPE_CONTRACT)
|
||||||
|
->setParameter('statusAssignment', [Assignment::STATUS_DELETED, Assignment::STATUS_CALLED_OFF])
|
||||||
->setParameter('dateFrom', $dateFrom->format('Y-m-d'))
|
->setParameter('dateFrom', $dateFrom->format('Y-m-d'))
|
||||||
->setParameter('status', Upload::STATUS_CHECKED)
|
->setParameter('statusContract', Upload::STATUS_CHECKED)
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->getResult()
|
->getResult()
|
||||||
;
|
;
|
||||||
@@ -68,4 +71,4 @@ class DispositionReminderService
|
|||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user