From: marina Date: Thu, 13 Jun 2024 07:07:27 +0000 (+0300) Subject: ERP-5 Доработать фактический план по сотрудникам X-Git-Tag: 1.2^2~4^2~4 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=94b807608283f83fbea78b900bf34677d0f7faec;p=erp24_rep%2Fyii-erp24%2F.git ERP-5 Доработать фактический план по сотрудникам --- diff --git a/erp24/views/timetable-fact/index.php b/erp24/views/timetable-fact/index.php index 22a92929..d76e5ee8 100644 --- a/erp24/views/timetable-fact/index.php +++ b/erp24/views/timetable-fact/index.php @@ -46,8 +46,11 @@ $this->params['breadcrumbs'][] = $this->title; }, ], [ - 'label' => 'Отработанное время', 'attribute' => 'work_time', + 'format' => 'raw', + 'value' => function ($model) { + return intval($model->work_time); + }, ], [ 'label' => 'Дата смены', @@ -86,7 +89,7 @@ $this->params['breadcrumbs'][] = $this->title; 'format' => 'raw', 'value' => function ($model) { if (!empty($model->checkin_end_id)) { - return !empty($photo = $model->checkinStart->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null; + return !empty($photo = $model->checkinEnd->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null; }; }, ], diff --git a/erp24/views/timetable-fact/view.php b/erp24/views/timetable-fact/view.php index 6b1308fe..22084db9 100644 --- a/erp24/views/timetable-fact/view.php +++ b/erp24/views/timetable-fact/view.php @@ -16,14 +16,14 @@ $this->title = "Фактический табель #$model->id";

title) ?>

- $model->id], ['class' => 'btn btn-primary']) ?> - $model->id], [ -// 'class' => 'btn btn-danger', -// 'data' => [ -// 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), -// 'method' => 'post', -// ], -// ]) ?> + $model->id], ['class' => 'btn btn-primary']) ?> + $model->id], [ + // 'class' => 'btn btn-danger', + // 'data' => [ + // 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), + // 'method' => 'post', + // ], + // ]) ?>

title = "Фактический табель #$model->id"; return Yii::$app->formatter->asDatetime($model->time_end, 'php:H:i:s'); }, ], - 'work_time', + [ + 'attribute' => 'work_time', + 'format' => 'raw', + 'value' => function ($model) { + return intval($model->work_time); + }, + ], [ 'attribute' => 'is_opening', 'format' => 'raw', @@ -118,7 +124,7 @@ $this->title = "Фактический табель #$model->id"; [ 'attribute' => 'admin_group_id', 'value' => function ($data) { - return $data->shift->name; + return !empty($data->shift_id) ? $data->shift->name : null; } ], [ @@ -142,17 +148,22 @@ $this->title = "Фактический табель #$model->id"; 'label' => 'Отметка о начале', 'format' => 'raw', 'value' => function ($model) { - return !empty($photo = $model->checkinStart->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null; + if (!empty($model->checkin_start_id)) { + return !empty($photo = $model->checkinStart->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null; + }; }, ], [ 'label' => 'Отметка о конце', 'format' => 'raw', 'value' => function ($model) { - return !empty($photo = $model->checkinEnd->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null; + if (!empty($model->checkin_end_id)) { + return !empty($photo = $model->checkinEnd->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null; + }; }, - ], - ], - ]) ?> + ] + ] + ]); + ?>