]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Вернул блок кода, добавив на него ограничение по времени feature_smirnov_erp-114_administrator_shift_salary_from_dict origin/feature_smirnov_erp-114_administrator_shift_salary_from_dict
authorAlexander Smirnov <fredeom@mail.ru>
Fri, 19 Jul 2024 08:22:17 +0000 (11:22 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Fri, 19 Jul 2024 08:22:17 +0000 (11:22 +0300)
erp24/services/CabinetService.php

index aaabd6002be33ec01112d61b792fa4f139d65602..81c0b123a96726a61bb29af02f811386d46edebf 100755 (executable)
@@ -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 {