From: marina Date: Fri, 5 Jul 2024 03:24:05 +0000 (+0300) Subject: ERP-65 X-Git-Tag: 1.3~17^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=280e718d57edc30bb3e42311ea34117d2abd603f;p=erp24_rep%2Fyii-erp24%2F.git ERP-65 Перенести в новый фактический табель все смены сотрудников, которые были до 13.06 --- diff --git a/erp24/controllers/TimetableFactController.php b/erp24/controllers/TimetableFactController.php index 197076e9..62735d0e 100644 --- a/erp24/controllers/TimetableFactController.php +++ b/erp24/controllers/TimetableFactController.php @@ -156,7 +156,7 @@ class TimetableFactController extends Controller $query = Timetable::find() ->alias('t') ->andWhere(['>=', 't.date', '2024-06-01']) - ->andWhere(['<', 't.date', date('Y-m-d')]) + ->andWhere(['<', 't.date', '2024-06-14']) ->andWhere(new \yii\db\Expression('EXISTS (SELECT 1 FROM admin_checkin ac WHERE ac.plan_id = "t".id)')) ->select([ 't.*', @@ -173,11 +173,7 @@ class TimetableFactController extends Controller ->andWhere(['store_id' => $timetable->store_id]) ->one(); - if ($newFact) { - $newFact->plan_id = $timetable->plan_id; - $newFact->tabel = $timetable->tabel; - $newFact->save(); - } else { + if (!$newFact) { $adminCheckinStart = AdminCheckin::find() ->andWhere(['plan_id' => $timetable->id]) ->orderBy('id asc') diff --git a/erp24/views/timetable-fact/add-old-shifts.php b/erp24/views/timetable-fact/add-old-shifts.php index e5e3f844..94ca2add 100644 --- a/erp24/views/timetable-fact/add-old-shifts.php +++ b/erp24/views/timetable-fact/add-old-shifts.php @@ -31,7 +31,7 @@ use \yii\widgets\ActiveForm;
- + 'btn btn-warning btn-lg', 'name' => 'action', 'value' => 'applyPlus']) ?>