From 1a95f0e900855585e6d5bf7ef63b5527d99d8649 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Fri, 19 Jul 2024 11:22:17 +0300 Subject: [PATCH] =?utf8?q?=D0=92=D0=B5=D1=80=D0=BD=D1=83=D0=BB=20=D0=B1?= =?utf8?q?=D0=BB=D0=BE=D0=BA=20=D0=BA=D0=BE=D0=B4=D0=B0,=20=D0=B4=D0=BE?= =?utf8?q?=D0=B1=D0=B0=D0=B2=D0=B8=D0=B2=20=D0=BD=D0=B0=20=D0=BD=D0=B5?= =?utf8?q?=D0=B3=D0=BE=20=D0=BE=D0=B3=D1=80=D0=B0=D0=BD=D0=B8=D1=87=D0=B5?= =?utf8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=20=D0=B2=D1=80=D0=B5=D0=BC?= =?utf8?q?=D0=B5=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/CabinetService.php | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) 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 { -- 2.39.5