| 123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace AppBundle\Entity\Billing\Repository;
- use AppBundle\Entity\Organization\Organization;
- use Doctrine\ORM\EntityRepository;
- /**
- * Class BillRepository
- * @package AppBundle\Entity\AccessAndFunction\Repository
- */
- class BillCreditRepository extends EntityRepository
- {
- public function findMaxBNumberByOrganization(Organization $organization)
- {
- $qb = $this->createQueryBuilder('b');
- $qb->select('max(b.billCreditInteger) as billCreditNumber')
- ->join('b.bill','bil')
- ->join('bil.access','acc')
- ->andWhere('acc.organization=:org')
- ->orderBy('b.id', 'DESC')
- ->setParameter(':org',$organization)
- ->setMaxResults(1);
- return $qb->getQuery()->getOneOrNullResult();
- }
- }
- ?>
|