feat: dedicated list view for document batch downloading
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Controller\Administrative\Document;
|
||||
|
||||
use App\Entity\Upload;
|
||||
use App\Model\DocumentFilterDto;
|
||||
use App\Repository\UploadRepository;
|
||||
use App\Service\Common\DocumentFilterHandler;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
@@ -42,4 +44,32 @@ class IndexController extends AbstractController
|
||||
'filterDto' => $filterDto,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(
|
||||
path: '/administrative/document/accepted/{type}',
|
||||
name: 'app_administrative_document_accepted',
|
||||
defaults: ['type' => Upload::TYPE_INVOICE]
|
||||
)]
|
||||
#[IsGranted('ROLE_ADMINISTRATIVE')]
|
||||
public function accepted(string $type, Request $request): Response
|
||||
{
|
||||
$status = Upload::TYPE_INVOICE === $type ? Upload::STATUS_PAID : Upload::STATUS_CHECKED;
|
||||
|
||||
$query = $this
|
||||
->uploadRepository
|
||||
->getBatchDownloadListQuery($type, $status)
|
||||
;
|
||||
|
||||
$pagination = $this->paginator->paginate(
|
||||
$query,
|
||||
$request->query->getInt('page', 1),
|
||||
$request->query->getInt('limit', 50),
|
||||
);
|
||||
|
||||
return $this->render('administrative/document/accepted.html.twig', [
|
||||
'pagination' => $pagination,
|
||||
'type' => $type,
|
||||
'status' => $status,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user