From 7215fc4a9c1ff46794d774c1f9b07b13a13c49bb Mon Sep 17 00:00:00 2001 From: Marina Zozirova Date: Fri, 5 Jul 2024 07:19:19 +0000 Subject: [PATCH] Fix script for plan --- erp24/controllers/TimetableFactController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erp24/controllers/TimetableFactController.php b/erp24/controllers/TimetableFactController.php index 7ffcce11..39a6cb4d 100644 --- a/erp24/controllers/TimetableFactController.php +++ b/erp24/controllers/TimetableFactController.php @@ -249,6 +249,7 @@ class TimetableFactController extends Controller ->andWhere(['date_shift' => $plan->date]) ->andWhere(['admin_id' => $plan->admin_id]) ->andWhere(['store_id' => $plan->store_id]) + ->orderBy('id asc') ->all(); if (sizeof($facts) > 1) { @@ -265,6 +266,7 @@ class TimetableFactController extends Controller $start->setAttribute('date_end', $end->date_start); $start->setAttribute('time_end', $end->time_start); $start->setAttribute('checkin_end_id', $end->checkin_start_id); + $start->setAttribute('work_time', min(abs(strtotime($end->date_start . $end->time_start) + 600 - strtotime($start->date_start . $start->time_start)) / 3600, TimetableFactModel::WORK_HOURS_TIME)); $start->setAttribute('autoclosed', 0); $start->save(); $end->delete(); -- 2.39.5