From 81c41fd46f08d550d41f40a28fc8a443cbc1ebdc Mon Sep 17 00:00:00 2001 From: marina Date: Wed, 18 Dec 2024 14:24:34 +0300 Subject: [PATCH] =?utf8?q?ERP-256=20=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D1=82?= =?utf8?q?=D1=8C=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D1=83=20?= =?utf8?q?=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=BE=D0=B2=20?= =?utf8?q?=D0=9F=D0=B5=D1=80=D0=B5=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=86?= =?utf8?q?=D0=B0=20=D0=B2=201=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/timetable/StartShiftStepTwoAction.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/erp24/actions/timetable/StartShiftStepTwoAction.php b/erp24/actions/timetable/StartShiftStepTwoAction.php index 06e35690..c944f35d 100755 --- a/erp24/actions/timetable/StartShiftStepTwoAction.php +++ b/erp24/actions/timetable/StartShiftStepTwoAction.php @@ -1,5 +1,5 @@ getIsPost()) { if (!empty($request->getBodyParam('store_id'))) { - $adminStoreId = (int) $request->getBodyParam('store_id'); + $adminStoreId = (int)$request->getBodyParam('store_id'); $firstRun = true; } } @@ -79,7 +79,7 @@ class StartShiftStepTwoAction extends Action if ($fact) { return AdminCheckin::TYPE_END; } - return AdminCheckin::TYPE_START; + return AdminCheckin::TYPE_START; })(); $model->shift_id = $request->getBodyParam('shift_id'); @@ -140,7 +140,9 @@ class StartShiftStepTwoAction extends Action $model->load($this->controller->request->post()); $model->photo = UploadedFile::getInstance($model, 'photo'); $validate = $model->validate(); - if ($validate) { + $twoMinutes = empty($fact->time_start) || !((strtotime(date('Y/m/d H:i:s')) - strtotime($fact->date_start . $fact->time_start)) < 120); + + if ($validate && $twoMinutes) { $model->save(); $model->checkin_id = $model->checkinModel->id; $model->id = $model->checkinModel->id; @@ -156,7 +158,6 @@ class StartShiftStepTwoAction extends Action ]; } - return $this->controller->render('/timetable/start_shift_step_three.php', [ 'userModel' => $userModel, 'model' => $model, -- 2.39.5