From ab99c873754940adf52d32d1775bc4a4c1e10d27 Mon Sep 17 00:00:00 2001 From: marina Date: Fri, 19 Jul 2024 11:46:11 +0300 Subject: [PATCH] =?utf8?q?ERP-115=20=D0=9F=D0=B5=D1=80=D0=B5=D1=80=D0=B0?= =?utf8?q?=D0=B1=D0=BE=D1=82=D0=B0=D1=82=D1=8C=20=D0=BE=D1=82=D0=BA=D1=80?= =?utf8?q?=D1=8B=D1=82=D0=B8=D0=B5/=D0=B7=D0=B0=D0=BA=D1=80=D1=8B=D1=82?= =?utf8?q?=D0=B8=D0=B5=20=D1=81=D0=BC=D0=B5=D0=BD=20=D1=83=20=D0=B0=D0=B4?= =?utf8?q?=D0=BC=D0=B8=D0=BD=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=82=D0=BE?= =?utf8?q?=D1=80=D0=BE=D0=B2=20=D0=BC=D0=B5=D0=BB=D0=BA=D0=BE=20=D0=BF?= =?utf8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF=D0=BE=20=D0=BF=D0=BB?= =?utf8?q?=D0=B0=D0=BD=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/timetable/StartShiftStepTwoAction.php | 3 +++ erp24/records/TimetableFactModel.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/erp24/actions/timetable/StartShiftStepTwoAction.php b/erp24/actions/timetable/StartShiftStepTwoAction.php index 0cc6fd4e..afc62b78 100755 --- a/erp24/actions/timetable/StartShiftStepTwoAction.php +++ b/erp24/actions/timetable/StartShiftStepTwoAction.php @@ -49,6 +49,8 @@ class StartShiftStepTwoAction extends Action ['date' => date('Y-m-d')], ['date' => date('Y-m-d', strtotime('-1 day'))], ]) + ->andWhere(['tabel' => 0]) + ->orderBy('id desc') ->one(); $fact = TimetableFactModel::getOpening($userModel->id, date('Y-m-d')); @@ -100,6 +102,7 @@ class StartShiftStepTwoAction extends Action if ($plan) { $model->shift_id = $plan->shift_id; $model->store_id = $plan->store_id; + $model->checkinModel->plan_id = $plan->id; } if ($fact) { diff --git a/erp24/records/TimetableFactModel.php b/erp24/records/TimetableFactModel.php index 8262672f..a6aa68df 100644 --- a/erp24/records/TimetableFactModel.php +++ b/erp24/records/TimetableFactModel.php @@ -129,10 +129,10 @@ class TimetableFactModel extends ActiveRecord $model->status = AdminCheckin::TYPE_START; $model->checkin_start_id = $adminCheckin->id; - $timetable = !empty($adminCheckin->plan_id) ? Timetable::findOne(['plan_id' => $adminCheckin->plan_id]) : null; + $timetable = !empty($adminCheckin->plan_id) ? Timetable::findOne(['id' => $adminCheckin->plan_id]) : null; if (!empty($timetable)) { $model->tabel = 1; - $model->plan_id = $timetable->plan_id; + $model->plan_id = $timetable->id; $model->shift_id = $timetable->shift_id; $model->admin_id_add = $timetable->admin_id_add; $model->comment = $timetable->comment; -- 2.39.5