From: Alexander Smirnov Date: Wed, 9 Oct 2024 11:58:57 +0000 (+0300) Subject: Убираем salary_shift из заявки для 1с и изменяем Employee_on_shift rules X-Git-Tag: 1.6~41^2~4 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=fdd1a6abf12bc0acc1399bf053e0ce7b0c7eaa38;p=erp24_rep%2Fyii-erp24%2F.git Убираем salary_shift из заявки для 1с и изменяем Employee_on_shift rules --- diff --git a/erp24/records/EmployeeOnShift.php b/erp24/records/EmployeeOnShift.php index 0be14777..1155474d 100644 --- a/erp24/records/EmployeeOnShift.php +++ b/erp24/records/EmployeeOnShift.php @@ -53,9 +53,9 @@ class EmployeeOnShift extends \yii\db\ActiveRecord // Сделать проверку этой таблички телефона return [ [['guid', 'phone', 'created_at', 'shift_date', 'shift_type', 'datetime_start', 'datetime_end', 'created_by', 'store_id', 'price'], 'required'], - [['created_at', 'shift_date', 'datetime_start', 'datetime_end'], 'safe'], + [['created_at', 'shift_date', 'datetime_start', 'datetime_end', 'salary_shift'], 'safe'], [['shift_type', 'created_by', 'price', 'status', 'status_source', 'active'], 'integer'], - [['salary_shift'], 'in', 'range' => Timetable::getSalariesDay(), 'skipOnEmpty' => false], + [['salary_shift'], 'in', 'range' => Timetable::getSalariesDay(), 'skipOnEmpty' => true], [['guid', 'store_id'], 'string', 'max' => 36], [['phone'], 'string', 'max' => 16], [['first_name', 'last_name'], 'string', 'max' => 40], diff --git a/erp24/scripts/tasks/task_22_create_employee_for_1c_with_admins_with_empty_guid.php b/erp24/scripts/tasks/task_22_create_employee_for_1c_with_admins_with_empty_guid.php index 2bc3e4c2..2b125e51 100644 --- a/erp24/scripts/tasks/task_22_create_employee_for_1c_with_admins_with_empty_guid.php +++ b/erp24/scripts/tasks/task_22_create_employee_for_1c_with_admins_with_empty_guid.php @@ -98,7 +98,7 @@ try { } } - $salaryShift = Timetable::getFirstValueSalariesDay(); +// $salaryShift = Timetable::getFirstValueSalariesDay(); $model = new EmployeeOnShift([ 'first_name' => $admin->name, 'last_name' => '', 'phone' => $admin->phone, @@ -108,7 +108,7 @@ try { 'created_by' => 1, 'store_id' => $storeGuid, 'price' => 0, - 'salary_shift' => $salaryShift, +// 'salary_shift' => $salaryShift, ]); $model->guid = DataHelper::createGuidMy("06"); $model->created_at = date("Y-m-d H:i:s"); @@ -118,6 +118,7 @@ try { $model->save(); if ($model->getErrors()) { $error .= json_encode($model->getErrors(), JSON_UNESCAPED_UNICODE); + continue; } $admin->guid = $model->guid;