- Модуль: timeman
- Путь к файлу: ~/bitrix/modules/timeman/classes/general/timeman_report_full.php
- Класс: CUserReportFull
- Вызов: CUserReportFull::getSubmitDateForNextReport
private function getSubmitDateForNextReport(int $lastReportDate, int $submitDay): int
{
if ($this->isSubmitDateReportSameMonth($lastReportDate, $submitDay))
{
$firstDayOfMonth = strtotime('first day of this month', $lastReportDate);
}
else
{
$firstDayOfMonth = strtotime('first day of next month', $lastReportDate);
}
$submitDate = $firstDayOfMonth + ($submitDay * $this->oneDayTime - $this->oneDayTime);
if (date('m', $firstDayOfMonth) != date('m', $submitDate))
{
if ($this->isSubmitDateReportSameMonth($lastReportDate, $submitDay))
{
return strtotime('last day of this month', $lastReportDate);
}
else
{
return strtotime('last day of next month', $lastReportDate);
}
}
return $submitDate;
}