feat: render additional info to teamer invoice
This commit is contained in:
@@ -4,11 +4,13 @@ namespace App\Controller\Administrative\Document;
|
||||
|
||||
use App\Controller\Traits\ReturnUrlTrait;
|
||||
use App\Entity\Upload;
|
||||
use App\Entity\User;
|
||||
use App\Event\DocumentConfirmedEvent;
|
||||
use App\Event\DocumentRejectedEvent;
|
||||
use App\Form\DocumentCheckType;
|
||||
use App\Htmx\HxRedirectResponse;
|
||||
use App\Model\DocumentCheckDto;
|
||||
use App\Service\Pdf\InvoiceApprover;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@@ -29,6 +31,7 @@ class CheckController extends AbstractController
|
||||
#[Target('disposition')]
|
||||
private readonly WorkflowInterface $workflow,
|
||||
private readonly EventDispatcherInterface $eventDispatcher,
|
||||
private readonly InvoiceApprover $invoiceApprover,
|
||||
private readonly LoggerInterface $logger
|
||||
) {
|
||||
}
|
||||
@@ -114,7 +117,18 @@ class CheckController extends AbstractController
|
||||
|
||||
private function confirmDocument(Upload $document, string $transition, string $status, DocumentCheckDto $formData): void
|
||||
{
|
||||
$document->setStatus($status);
|
||||
/** @var User $user */
|
||||
$user = $this->getUser();
|
||||
$document
|
||||
->setApprovedAt(new \DateTimeImmutable())
|
||||
->setApprovedBy($user->getInitials())
|
||||
->setStatus($status)
|
||||
;
|
||||
|
||||
if (Upload::TYPE_INVOICE === $document->getType()) {
|
||||
$this->invoiceApprover->render($document->getDisposition());
|
||||
}
|
||||
|
||||
$this->addFlash('success', 'Das Dokument wurde bestätigt');
|
||||
$this->logger->info('Confirm document', [
|
||||
'document_id' => $document->getId(),
|
||||
|
||||
Reference in New Issue
Block a user