From: Alexander Smirnov Date: Fri, 19 Jul 2024 08:22:17 +0000 (+0300) Subject: Вернул блок кода, добавив на него ограничение по времени X-Git-Tag: 1.4~69^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=1a95f0e900855585e6d5bf7ef63b5527d99d8649;p=erp24_rep%2Fyii-erp24%2F.git Вернул блок кода, добавив на него ограничение по времени --- diff --git a/erp24/services/CabinetService.php b/erp24/services/CabinetService.php index aaabd600..81c0b123 100755 --- a/erp24/services/CabinetService.php +++ b/erp24/services/CabinetService.php @@ -2384,11 +2384,29 @@ class CabinetService $normalCountShiftArray = SalaryHelper::$normalCountShift; if (!empty($employeeSelect["group_id"])) { - $employeeSelectGroupId = $this->getGroupId($employeeId, $employeeSelect['group_id'], $dateFrom, $dateTo); - if (array_key_exists($employeeSelectGroupId, $normalCountShiftArray)) { - $normalCountShift = $normalCountShiftArray[$employeeSelectGroupId]; + if (($dateFrom < '2024-07-01') && (Admin::ADMINISTRATOR_GROUP_ID == $employeeSelect["group_id"])){ + if ($dateFrom >= '2023-12-01') { + $dayMonthDateRow = $yearSelect . '-' . $monthSelect . '-01'; + $timeRow = strtotime($dayMonthDateRow); + $monthSelectRow = date('n', $timeRow); + $yearSelectRow = date('Y', $timeRow); + if ($yearSelectRow == '2024' && $monthSelectRow == 1) { + $normalCountShift = 20; + } else { + // у Администратора число смен равно количеству дней со вторника по субботу в месяце + $normalCountShift = HtmlHelper::getAdministratorWorkDays($monthSelect, $yearSelect); + } + } else { + // у Администратора число смен равно количеству рабочих дней в месяце + $normalCountShift = HtmlHelper::getWorkDays($monthSelect, $yearSelect); + } } else { - $normalCountShift = 15; + $employeeSelectGroupId = $this->getGroupId($employeeId, $employeeSelect['group_id'], $dateFrom, $dateTo); + if (array_key_exists($employeeSelectGroupId, $normalCountShiftArray)) { + $normalCountShift = $normalCountShiftArray[$employeeSelectGroupId]; + } else { + $normalCountShift = 15; + } } } @@ -2495,7 +2513,7 @@ class CabinetService if (!empty($normalCountShift)) { if ($isAdministrator) { - if ($dateFrom >= '2024-08-01') { + if ($dateFrom >= '2024-07-01') { $normalCostShift = $monthlySalary['daily_payment']; $dailyPayment = $monthlySalary['daily_payment']; } else {