EcommerceBundle/Entity/Repository/InvoiceRepository.php
public function getNextNumber()
    {
        if (0 === (int) $this->countTotal()) {
            return 1;
        }

        $qb = $this->getQueryBuilder()
            ->select('MAX(i.invoiceNumber) + 1');

        return $qb->getQuery()
            ->getSingleScalarResult();
    }
public function getNextNumber()
    {
        if (0 === (int) $this->countTotal()) {
            return 1;
        }

        $qb = $this->getQueryBuilder()
            ->select('MAX(i.invoiceNumber) + 1');

        return $qb->getQuery()
            ->getSingleScalarResult();
    }
public function getNextNumber ( ) { if ( 0 === ( int ) $ this -> countTotal ( ) ) { return 1 ; } $ qb = $ this -> getQueryBuilder ( ) -> select ( 'MAX(i.invoiceNumber) + 1' ) ; return $ qb -> getQuery ( ) -> getSingleScalarResult ( ) ; }
Get next invoice number

@return int
Get next invoice number