• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/violation/fixedscheduleviolationbuilder.php
  • Класс: BitrixTimemanServiceWorktimeViolationFixedScheduleViolationBuilder
  • Вызов: FixedScheduleViolationBuilder::buildOffsetStopViolations
private function buildOffsetStopViolations($recordedStopSeconds)
{
	$minOffsetEnd = $this->getViolationRules()->getMinOffsetEnd();
	if (!$this->getShift() || !ViolationRules::isViolationConfigured($minOffsetEnd))
	{
		return [];
	}

	$violations = [];

	if ($recordedStopSeconds < $this->getShift()->getWorkTimeEnd() - $minOffsetEnd)
	{
		$violations[] = $this->createViolation(
			WorktimeViolation::TYPE_EARLY_ENDING,
			$this->getRecord()->getRecordedStopTimestamp(),
			$recordedStopSeconds - $this->getShift()->getWorkTimeEnd() + $minOffsetEnd
		);
	}

	return $violations;
}