• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/violation/worktimeviolationbuilder.php
  • Класс: BitrixTimemanServiceWorktimeViolationWorktimeViolationBuilder
  • Вызов: WorktimeViolationBuilder::buildEditBreakLengthViolations
private function buildEditBreakLengthViolations($checkAllowedDelta = true)
{
	$record = $this->getRecord();
	$allowedDiff = 0;
	if ($checkAllowedDelta)
	{
		$allowedDiff = $this->getViolationRules()->getMaxAllowedToEditWorkTime();
	}
	if (abs($record->getActualBreakLength() - $record->getTimeLeaks()) > $allowedDiff)
	{
		return [
			$this->createViolation(
				WorktimeViolation::TYPE_EDITED_BREAK_LENGTH,
				$record->getTimeLeaks(),
				$record->getTimeLeaks() - $record->getActualBreakLength()
			),
		];
	}
	return [];
}