From 6de02d06ac0af49db13617a6d4ed17dfb86516fb Mon Sep 17 00:00:00 2001 From: Marina Zozirova Date: Mon, 17 Jun 2024 05:58:38 +0000 Subject: [PATCH] Fixes erp 5 --- erp24/api2/config/api2.config.php | 1 + erp24/records/TimetableFactModel.php | 2 +- erp24/views/timetable-fact/index.php | 2 +- erp24/views/timetable-fact/view.php | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/erp24/api2/config/api2.config.php b/erp24/api2/config/api2.config.php index 6ef9ed83..8aaaf733 100644 --- a/erp24/api2/config/api2.config.php +++ b/erp24/api2/config/api2.config.php @@ -88,6 +88,7 @@ return [ '@bower' => '@vendor/bower-asset', '@npm' => '@vendor/npm-asset', '@dist' => '@app/dist', + '@uploads' => "@app/uploads", ], 'params' => require dirname(__DIR__, 2) . '/config/params.php', 'timeZone' => 'Europe/Moscow', diff --git a/erp24/records/TimetableFactModel.php b/erp24/records/TimetableFactModel.php index 06626b97..4f8c318a 100644 --- a/erp24/records/TimetableFactModel.php +++ b/erp24/records/TimetableFactModel.php @@ -113,7 +113,7 @@ class TimetableFactModel extends ActiveRecord $model->time_end = date("H:i:s", strtotime($adminCheckin->time)); $model->is_close = true; $model->is_opening = false; - $model->work_time = min((strtotime($model->time_end) - strtotime($model->time_start)) / 3600, self::WORK_HOURS_TIME); + $model->work_time = min(abs(strtotime($model->time_end) - strtotime($model->time_start)) / 3600, self::WORK_HOURS_TIME); $model->status = AdminCheckin::TYPE_END; $model->checkin_end_id = $adminCheckin->id; diff --git a/erp24/views/timetable-fact/index.php b/erp24/views/timetable-fact/index.php index 11ddd103..be6f0ced 100644 --- a/erp24/views/timetable-fact/index.php +++ b/erp24/views/timetable-fact/index.php @@ -49,7 +49,7 @@ $this->params['breadcrumbs'][] = $this->title; 'attribute' => 'work_time', 'format' => 'raw', 'value' => function ($model) { - return intval($model->work_time); + return abs(intval($model->work_time)); }, ], [ diff --git a/erp24/views/timetable-fact/view.php b/erp24/views/timetable-fact/view.php index 9b151402..83437bc1 100644 --- a/erp24/views/timetable-fact/view.php +++ b/erp24/views/timetable-fact/view.php @@ -95,7 +95,7 @@ $this->title = "Фактический табель #$model->id"; 'attribute' => 'work_time', 'format' => 'raw', 'value' => function ($model) { - return intval($model->work_time); + return abs(intval($model->work_time)); }, ], [ -- 2.39.5