From: marina Date: Thu, 4 Jul 2024 05:38:54 +0000 (+0300) Subject: ERP-65 X-Git-Tag: 1.3~23^2~1 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=4e2998d25a4f4f180ae1359e3e1e3a100d5dc2f1;p=erp24_rep%2Fyii-erp24%2F.git ERP-65 Перенести в новый фактический табель все смены сотрудников, которые были до 13.06 --- diff --git a/erp24/actions/timetable/StartShiftStepOneAction.php b/erp24/actions/timetable/StartShiftStepOneAction.php index 937d5b00..f7f6ba94 100755 --- a/erp24/actions/timetable/StartShiftStepOneAction.php +++ b/erp24/actions/timetable/StartShiftStepOneAction.php @@ -38,7 +38,6 @@ class StartShiftStepOneAction extends Action ->all(); $lastCheckin = end($dayCheckins); - $modelTypeId = (function () use ($userModel, $lastCheckin) { if ($userModel->adminGroup->isRoaming()) { return AdminCheckin::TYPE_APPEAR; diff --git a/erp24/api3/core/services/TimetableService.php b/erp24/api3/core/services/TimetableService.php index 1c620730..5cb9ab40 100644 --- a/erp24/api3/core/services/TimetableService.php +++ b/erp24/api3/core/services/TimetableService.php @@ -96,7 +96,7 @@ class TimetableService } if ($checkIn->save()) { - TimetableFactModel::setValues($checkIn, true); + TimetableFactModel::setValues($checkIn); } if ($checkIn->getErrors()) { diff --git a/erp24/commands/TimetableController.php b/erp24/commands/TimetableController.php index 5653f944..33f3bc5e 100644 --- a/erp24/commands/TimetableController.php +++ b/erp24/commands/TimetableController.php @@ -2,7 +2,7 @@ namespace yii_app\commands; -use app\records\TimetableFactModel; +use yii_app\records\TimetableFactModel; use yii\console\Controller; use yii\helpers\Json; use yii_app\records\AdminCheckin; diff --git a/erp24/controllers/TimetableFactController.php b/erp24/controllers/TimetableFactController.php index d6267660..38d8595f 100644 --- a/erp24/controllers/TimetableFactController.php +++ b/erp24/controllers/TimetableFactController.php @@ -199,7 +199,7 @@ class TimetableFactController extends Controller if ($adminCheckinEnd && $adminCheckinStart->id != $adminCheckinEnd->id) { $adminCheckinEnd->shift_id = $timetable->shift_id; - TimetableFactModel::setValues($adminCheckinEnd); + TimetableFactModel::setValues($adminCheckinEnd, false); } } } @@ -226,7 +226,7 @@ class TimetableFactController extends Controller $newCheckin->time = $timetable->datetime_end; $newCheckin->type_id = $timetable->shift_id == 5 || $timetable->shift_id = 8 ? AdminCheckin::TYPE_APPEAR : AdminCheckin::TYPE_END; $newCheckin->validate(); - TimetableFactModel::setValues($newCheckin); + TimetableFactModel::setValues($newCheckin, false); } } } diff --git a/erp24/records/AdminCheckin.php b/erp24/records/AdminCheckin.php index f0b7cab1..91f32ea7 100755 --- a/erp24/records/AdminCheckin.php +++ b/erp24/records/AdminCheckin.php @@ -34,7 +34,6 @@ class AdminCheckin extends ActiveRecord public $shift_id; public $cnt; public $adminGuid; - public $shift_id; const TYPE_START = 1; const TYPE_END = 2; const TYPE_APPEAR = 3; diff --git a/erp24/records/TimetableFactModel.php b/erp24/records/TimetableFactModel.php index bd05686b..d094f203 100644 --- a/erp24/records/TimetableFactModel.php +++ b/erp24/records/TimetableFactModel.php @@ -102,7 +102,12 @@ class TimetableFactModel extends ActiveRecord ]; } - public static function setValues($adminCheckin, $is_start) + //is_start моя пометка для выравнивания открытия/закрытия натыканных флористами смен + + /** + * @throws \Exception + */ + public static function setValues($adminCheckin, $is_start = true) { if ($model = self::find() ->where(['admin_id' => $adminCheckin->admin_id, 'is_opening' => true])