From: Vladimir Fomichev Date: Tue, 2 Dec 2025 07:14:47 +0000 (+0300) Subject: Дневной отчет X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=516f65b7b56a0be68e9e4dcff67929966a4821bd;p=erp24_rep%2Fyii-erp24%2F.git Дневной отчет --- diff --git a/erp24/actions/grade/IndexAction.php b/erp24/actions/grade/IndexAction.php index 653ba7ff..5e82ef29 100755 --- a/erp24/actions/grade/IndexAction.php +++ b/erp24/actions/grade/IndexAction.php @@ -56,7 +56,15 @@ class IndexAction extends Action $adminChats = ArrayHelper::map(AdminChats::find()->select(['admin_id'])->where(['state' => 2])->all(), 'admin_id', 'admin_id'); + // Определяем специальные группы для подсветки строк + $specialGroups = AdminGroup::getWorkersGroups(); + // Ищем группу "Работники магазинов" по имени + $workersGroup = AdminGroup::find()->where(['name' => AdminGroup::GROUP_STORE_WORKERS_NAME])->one(); + if ($workersGroup) { + $specialGroups[] = $workersGroup->id; + } + return $this->controller->render('/grade/index', - compact('searchModel', 'admins', 'adminGroups', 'stores', 'adminChats')); + compact('searchModel', 'admins', 'adminGroups', 'stores', 'adminChats', 'specialGroups')); } } \ No newline at end of file diff --git a/erp24/api3/core/services/ReportService.php b/erp24/api3/core/services/ReportService.php index fbf95dfa..7e405a36 100644 --- a/erp24/api3/core/services/ReportService.php +++ b/erp24/api3/core/services/ReportService.php @@ -1695,6 +1695,7 @@ class ReportService "employee_positions_on_shift" => $storeEmployeePositionsOnShift, "employee_skills_score" => $employeeSkillsScore, "employee_skills_score_is_estimated" => $skillsScoreIsEstimated, + "employee_count_on_shift" => $employeeCount[$store_id] ?? 0, ]; $stores [] = [ 'id' => $store_id, @@ -1769,6 +1770,7 @@ class ReportService $total["bonus_user_count"] / $total["sale_quantity"] * 100 ) : 0; $total["employee_positions_on_shift"] = $employeePositionsOnShift; + $total["employee_count_on_shift"] = count($allDayEmployees); $report = [ "date" => $day, diff --git a/erp24/views/grade/index.php b/erp24/views/grade/index.php index 39c0096f..b01c6e34 100755 --- a/erp24/views/grade/index.php +++ b/erp24/views/grade/index.php @@ -2,7 +2,6 @@ use yii\helpers\Html; use yii\widgets\ActiveForm; - use kartik\select2\Select2; /** @var array $admins */ @@ -10,6 +9,7 @@ use kartik\select2\Select2; /** @var array $adminGroups */ /** @var array $stores */ /** @var array $adminChats */ +/** @var array $specialGroups */ ?> @@ -77,7 +77,14 @@ use kartik\select2\Select2; -
+ group_id, $specialGroups); + $hasNoPosition = empty($admin->employee_position_id); + $shouldHighlight = $isSpecialGroup && $hasNoPosition; + $rowStyle = $shouldHighlight ? 'background-color: #FFF4E6;' : ''; + ?> +
render('/pages/admin-info', ['admin' => $admin]) ?>