• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/violation/shiftedscheduleviolationbuilder.php
  • Класс: BitrixTimemanServiceWorktimeViolationShiftedScheduleViolationBuilder
  • Вызов: ShiftedScheduleViolationBuilder::buildStartViolations
protected function buildStartViolations()
{
	$shift = $this->getShift();
	if (!$shift)
	{
		return [];
	}
	$record = $this->getRecord();
	$recordedStartSeconds = $this->getTimeHelper()->getSecondsFromDateTime($record->buildRecordedStartDateTime());
	$violations = [];
	$offset = $this->getViolationRules()['MAX_SHIFT_START_DELAY'];
	if (ViolationRules::isViolationConfigured($offset))
	{
		if (($recordedStartSeconds - $shift->getWorkTimeStart()) > $offset)
		{
			$violations[] = $this->createViolation(
				WorktimeViolation::TYPE_SHIFT_LATE_START,
				$record->getRecordedStartTimestamp(),
				$recordedStartSeconds - $shift->getWorkTimeStart() - $offset
			);
		}
	}
	return $violations;
}