feat(export) : ajout export Excel des réceptions et expéditions terminées (FER-22)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-19 15:48:29 +02:00
parent de39207102
commit e4f7ca7b18
11 changed files with 894 additions and 2 deletions

View File

@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace App\Repository;
use App\Entity\Reception;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Reception>
*/
final class ReceptionRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Reception::class);
}
/**
* Liste des réceptions validées pour l'export Excel (de la plus récente à la plus ancienne).
*
* @return list<Reception>
*/
public function findValidatedForExport(): array
{
return $this->createQueryBuilder('r')
->leftJoin('r.supplier', 'supplier')->addSelect('supplier')
->leftJoin('supplier.addresses', 'supplierAddresses')->addSelect('supplierAddresses')
->leftJoin('r.address', 'address')->addSelect('address')
->leftJoin('r.carrier', 'carrier')->addSelect('carrier')
->leftJoin('r.driver', 'driver')->addSelect('driver')
->leftJoin('r.truck', 'truck')->addSelect('truck')
->leftJoin('r.user', 'user')->addSelect('user')
->leftJoin('r.receptionType', 'receptionType')->addSelect('receptionType')
->leftJoin('r.merchandiseType', 'merchandiseType')->addSelect('merchandiseType')
->leftJoin('r.weights', 'weights')->addSelect('weights')
->leftJoin('r.bovines_types', 'bovinesTypes')->addSelect('bovinesTypes')
->leftJoin('bovinesTypes.bovineType', 'bovineType')->addSelect('bovineType')
->leftJoin('r.pelletBuildings', 'pelletBuildings')->addSelect('pelletBuildings')
->leftJoin('pelletBuildings.pelletType', 'pelletType')->addSelect('pelletType')
->leftJoin('pelletBuildings.building', 'pelletBuilding')->addSelect('pelletBuilding')
->where('r.isValid = :valid')
->setParameter('valid', true)
->orderBy('r.receptionDate', 'DESC')
->addOrderBy('r.id', 'DESC')
->getQuery()
->getResult()
;
}
}