Feat: Add even more guards
This commit is contained in:
1 parent
f5e88b5418
commit
789249cba7
2 files changed
+11
No files matched your search
@@ -69,6 +69,16 @@ class DispositionWorkflowGuardSubscriber implements EventSubscriberInterface
|
||||
$destination = $assignment->getDestination();
|
||||
$today = new \DateTimeImmutable();
|
||||
|
||||
$contractDocument = $disposition->getDocumentByType(Upload::TYPE_CONTRACT);
|
||||
|
||||
if (null === $contractDocument || Upload::STATUS_CHECKED !== $contractDocument->getStatus()) {
|
||||
$message = $this
|
||||
->translator
|
||||
->trans('message.upload_invoice.contract_missing_or_not_checked')
|
||||
;
|
||||
$event->setBlocked(true, $message);
|
||||
}
|
||||
|
||||
$earliestDate = $destination->getDateFrom();
|
||||
|
||||
if ($earliestDate > $today) {
|
||||
|
||||
Reference in new issue
Block a user