• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/numerator/generator/sequentnumbergenerator.php
  • Класс: BitrixMainNumeratorGeneratorSequentNumberGenerator
  • Вызов: SequentNumberGenerator::resetCurrentNumberIfNeeded
private function resetCurrentNumberIfNeeded()
{
	if ($this->periodicBy)
	{
		if ($this->periodicBy == static::YEAR && $this->isHasChanged(static::YEAR))
		{
			$this->currentNumber = $this->start;
		}
		if ($this->periodicBy == static::MONTH)
		{
			if ($this->isHasChanged(static::MONTH) || $this->isSameMonthButDifferentYear())
			{
				$this->currentNumber = $this->start;
			}
		}
		if ($this->periodicBy == static::DAY)
		{
			if ($this->isHasChanged(static::DAY)
				|| $this->isSameDayButDifferent(static::MONTH)
				|| $this->isSameDayButDifferent(static::YEAR))
			{
				$this->currentNumber = $this->start;
			}
		}
	}
}