Get next invoice number

@return int
332697
public function getNextNumber()
    {
        if (0 === (int) $this->countTotal()) {
            return 1;
        }

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

        return $qb->getQuery()
            ->getSingleScalarResult();
    }
1329978
public function next()
    {
        if ((int) $this->current()->query->getValue('o') >= $this->nbPages) {
            return null;
        }

        return $this->getIndexUrl(+1);
    }
835912
public function getNextAddress()
    {
        $overflow = false;
        $words = $this->getWords();
        for ($i = count($words) - 1; $i >= 0; --$i) {
            if ($words[$i] === 0xffff) {
                if ($i === 0) {
                    $overflow = true;
                    break;
                }
                $words[$i] = 0;
            } else {
                ++$words[$i];
                break;
            }
        }

        return $overflow ? null : static::fromWords($words);
    }
1044535
protected function getNext() {
		if ($this->get('page')< $this->pageTotal) {
			return $this->replaceLine($this->get('page')+ 1, $this->get('next'));
		}
		return null;
	}
1163988
public function getNextId()
    {
        $sql   = 'UPDATE ' . $this->table . ' SET value = LAST_INSERT_ID(value + 1) WHERE name = ?';

        $result   = $this->db->query($sql, array($this->name));
        $rowCount = $result->rowCount();

        if (1 !== $rowCount) {
            throw new Exception("Sequence '" . $this->name . "' not found.");
        }

        $createdId = $this->db->lastInsertId();

        return (int) $createdId;
    }
1039600
public function getInvoiceAddress()
    {
        if ($this->_aInvoiceAddress == null) {
            $invoiceAddress = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('invadr');
            if ($invoiceAddress) {
                $this->_aInvoiceAddress = $invoiceAddress;
            }
        }

        return $this->_aInvoiceAddress;
    }
984159
public function nextMail()
    {
        if ( $this->hasMoreMailData === false )
        {
            $this->hasMoreMailData = true;
            return $this->openFile( true );
        }
        return $this->openFile();
    }
950568
public function getNext()
    {
        return $this
            ->where(self::ATTR_PAGE, $this->getPageId())
            ->where(self::ATTR_CREATED_AT, '>', $this->getEditedTime()->getTimestamp())
            ->orderBy(self::ATTR_CREATED_AT, 'asc')
            ->first();
    }
227220
public function upcomingInvoice(): ?Invoice
    {
        try {
            $stripeInvoice = StripeInvoice::upcoming(
                ['customer' => $this->stripe_id], ['api_key' => $this->getStripeKey()]
            );

            return new Invoice($this, $stripeInvoice);
        } catch (InvalidRequest $e) {
        }
    }
342912
public function fetchNextObject()
	{
		if( $this->cursor < $this->RecordCount() )
		{
			$this->cursor ++;
			return $this->rows[$this->cursor-1];
		}
		else return FALSE;
	}
562089
public function getNextToken()
    {
        if (null === $this->_nextToken) {
            $tokenSelect = $this->tracker->getTokenSelect();
            $tokenSelect
                    ->andReceptionCodes()
                    ->forPreviousTokenId($this->_tokenId);

            if ($tokenData = $tokenSelect->fetchRow()) {
                $this->_nextToken = $this->tracker->getToken($tokenData);
                $this->_nextToken->_previousToken = $this;
            } else {
                $this->_nextToken = false;
            }
        }

        return $this->_nextToken;
    }
407676
public static function get($invoiceNumber, $client = null) {
    return self::_get(Recurly_Invoice::uriForInvoice($invoiceNumber), $client);
  }
538494
protected function getNextId()
    {
        $keys = $this->getFileManager()->keys();
        $ids = array();
        foreach($keys as $key) {
            if(preg_match('/^'.$this->getHash().'/', $key)) {
                $ids[] = str_replace($this->getHash(), '', $key);
            }
        }
        if(empty($ids)) {
            return 1;
        }
        
        $maxId = max($ids);
        
        return $maxId + 1;
    }
348091
public function getTotalItemNumber()
    {
        return array_reduce(
            $this->cartLines->toArray(),
            function ($previousTotal, CartLineInterface $current) {
                return $previousTotal + $current->getQuantity();
            },
            0
        );
    }
212968
protected function getNextFusionLine()
    {
        $fusionLine = current($this->currentSourceCodeLines);
        next($this->currentSourceCodeLines);
        $this->currentLineNumber++;
        return $fusionLine;
    }
151527
public function getProductNumber()
    {
        /** @var $this OxpsPaymorrowOxBasketItem|oxBasketItem */

        /** @var oxArticle $oArticle */
        $oArticle = $this->getArticle();

        return isset( $oArticle->oxarticles__oxartnum->value ) ? (string) $oArticle->oxarticles__oxartnum->value : '';
    }
510324
private function getNextInteration()
    {
        // Get the next interator.
        $migrations = new Filesystem(new Adapter(base_path('database/migrations')));

        try {
            $files = $migrations->listContents();
        } catch (\Exception $exception) {
            $this->error($exception->getMessage());

            exit(1);
        }

        $files_filtered = array_filter($files, function ($value) {
            return stripos($value['filename'], date('Y_m_d')) !== false;
        });

        if (count($files_filtered) == 0) {
            return 1;
        }

        $files_filtered = array_column($files_filtered, 'path');

        sort($files_filtered);
        $latest_file = array_pop($files_filtered);
        $latest_details = explode('_', $latest_file);

        return (int) $latest_details[3] + 1;
    }