feat: download ZIP archive of invoices with status 'paid'
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Repository\Traits\QueryHelperTrait;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use setasign\Fpdi\PdfParser\CrossReference\AbstractReader;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Upload>
|
||||
@@ -79,6 +80,25 @@ class UploadRepository extends ServiceEntityRepository
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getBatchDownloadList(
|
||||
string $type = Upload::TYPE_INVOICE,
|
||||
string $status = Upload::STATUS_PAID
|
||||
): array {
|
||||
$qb = $this->createQueryBuilder('upload');
|
||||
|
||||
return $qb->where(
|
||||
$qb->expr()->andX(
|
||||
$qb->expr()->eq('upload.type', ':type'),
|
||||
$qb->expr()->eq('upload.status', ':status'),
|
||||
$qb->expr()->isNull('upload.downloadedAt'),
|
||||
))
|
||||
->setParameter('type', $type)
|
||||
->setParameter('status', $status)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function getUploadListQuery(DocumentFilterDto $filterDto): Query
|
||||
{
|
||||
$qb = $this->createQueryBuilder('upload');
|
||||
|
||||
Reference in New Issue
Block a user