feat: dedicated dashboard widgets for contracts and invoices

This commit is contained in:
Björn Fromme committed 2025-01-15 16:17:55 +01:00
1 parent 6af42e5703
commit b62cf18ede
5 files changed
+194 -97

No files matched your search

+12 -6
View File
@@ -38,9 +38,12 @@ class IndexController extends AbstractController
$availabilities = $this->entityManager->getRepository(Availability::class)->getNew();
$uploadRepository = $this->entityManager->getRepository(Upload::class);
$documents = $uploadRepository->getNew();
$newDocumentsCount = $uploadRepository->getCountByStatus(Upload::STATUS_NEW);
$pendingDocumentsCount = $uploadRepository->getCountByStatus(Upload::STATUS_PENDING);
$newContracts = $uploadRepository->getNewByType(Upload::TYPE_CONTRACT);
$newContractsCount = $uploadRepository->getCountByStatusAndType(Upload::STATUS_NEW, Upload::TYPE_CONTRACT);
$pendingContractsCount = $uploadRepository->getCountByStatusAndType(Upload::STATUS_PENDING, Upload::TYPE_CONTRACT);
$newInvoices = $uploadRepository->getNewByType(Upload::TYPE_INVOICE);
$newInvoicesCount = $uploadRepository->getCountByStatusAndType(Upload::STATUS_NEW, Upload::TYPE_INVOICE);
$pendingInvoicesCount = $uploadRepository->getCountByStatusAndType(Upload::STATUS_PENDING, Upload::TYPE_INVOICE);
$dispositionRepository = $this->entityManager->getRepository(Disposition::class);
$overdueContracts = $dispositionRepository->findOverdueContracts();
@@ -55,9 +58,12 @@ class IndexController extends AbstractController
'pendingFeedbacksCount' => $pendingFeedbacksCount,
'assignments' => $assignments,
'availabilities' => $availabilities,
'documents' => $documents,
'newDocumentsCount' => $newDocumentsCount,
'pendingDocumentsCount' => $pendingDocumentsCount,
'newContracts' => $newContracts,
'newContractsCount' => $newContractsCount,
'pendingContractsCount' => $pendingContractsCount,
'newInvoices' => $newInvoices,
'newInvoicesCount' => $newInvoicesCount,
'pendingInvoicesCount' => $pendingInvoicesCount,
'overdueContracts' => $overdueContracts,
'newDispositions' => $newDispositions,
'overdueFeedbacks' => $overdueFeedbacks,
+20 -6
View File
@@ -22,16 +22,30 @@ class IndexController extends AbstractController
{
$dispositions = $this->dispositionRepository->getNew();
$documents = $this->uploadRepository->getNew();
$newDocumentsCount = $this->uploadRepository->getCountByStatus(Upload::STATUS_NEW);
$pendingDocumentsCount = $this->uploadRepository->getCountByStatus(Upload::STATUS_PENDING);
$newContracts = $this->uploadRepository->getNewByType(Upload::TYPE_CONTRACT);
$newContractsCount = $this
->uploadRepository
->getCountByStatusAndType(Upload::STATUS_NEW, Upload::TYPE_CONTRACT);
$pendingContractsCount = $this
->uploadRepository
->getCountByStatusAndType(Upload::STATUS_PENDING, Upload::TYPE_CONTRACT);
$newInvoices = $this->uploadRepository->getNewByType(Upload::TYPE_INVOICE);
$newInvoicesCount = $this
->uploadRepository
->getCountByStatusAndType(Upload::STATUS_NEW, Upload::TYPE_INVOICE);
$pendingInvoicesCount = $this
->uploadRepository
->getCountByStatusAndType(Upload::STATUS_PENDING, Upload::TYPE_INVOICE);
$overdueFeedbacks = $this->dispositionRepository->findDispositionsWithOverdueFeedback(7);
return $this->render('manager/index.html.twig', [
'dispositions' => $dispositions,
'documents' => $documents,
'newDocumentsCount' => $newDocumentsCount,
'pendingDocumentsCount' => $pendingDocumentsCount,
'newContracts' => $newContracts,
'newContractsCount' => $newContractsCount,
'pendingContractsCount' => $pendingContractsCount,
'newInvoices' => $newInvoices,
'newInvoicesCount' => $newInvoicesCount,
'pendingInvoicesCount' => $pendingInvoicesCount,
'overdueFeedbacks' => $overdueFeedbacks,
]);
}