From: marina Date: Thu, 4 Jul 2024 06:58:56 +0000 (+0300) Subject: ERP-65 X-Git-Tag: 1.3~23^2~4 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=9374ff7c645557a7e88cca3325f765c0d25341d8;p=erp24_rep%2Fyii-erp24%2F.git ERP-65 Перенести в новый фактический табель все смены сотрудников, которые были до 13.06 --- diff --git a/erp24/controllers/TimetableFactController.php b/erp24/controllers/TimetableFactController.php index d9b53ec9..14c40a1c 100644 --- a/erp24/controllers/TimetableFactController.php +++ b/erp24/controllers/TimetableFactController.php @@ -165,7 +165,6 @@ class TimetableFactController extends Controller ->andWhere(['is not', 'plan_id', null]) ->all(); - foreach ($timetables as $timetable) { $newFact = TimetableFactModel::find() ->andWhere(['date_shift' => $timetable->date]) @@ -199,10 +198,10 @@ class TimetableFactController extends Controller } } - if ($timetable && empty($adminCheckinStart) && empty($adminCheckinEnd)) { + if ($timetable && empty($adminCheckinStart) && empty($adminCheckinEnd) && empty($newFact)) { $newCheckin = new AdminCheckin(); $newCheckin->admin_id = $timetable->admin_id; - $newCheckin->type_id = $timetable->shift_id == 5 || $timetable->shift_id = 8 ? AdminCheckin::TYPE_APPEAR : AdminCheckin::TYPE_START; + $newCheckin->type_id = $timetable->shift_id == 5 || $timetable->shift_id == 8 ? AdminCheckin::TYPE_APPEAR : AdminCheckin::TYPE_START; $newCheckin->date = $timetable->date; $newCheckin->shift_id = $timetable->shift_id; $newCheckin->time = $timetable->datetime_start; @@ -222,6 +221,7 @@ class TimetableFactController extends Controller $newCheckin->type_id = $timetable->shift_id == 5 || $timetable->shift_id = 8 ? AdminCheckin::TYPE_APPEAR : AdminCheckin::TYPE_END; $newCheckin->validate(); TimetableFactModel::setValues($newCheckin); + var_dump($timetable, $newCheckin);die(); } } }