From: marina Date: Thu, 8 Aug 2024 19:50:12 +0000 (+0300) Subject: правка закрытия смены X-Git-Tag: 1.4~41^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=refs%2Fremotes%2Forigin%2Ffixing_closing;p=erp24_rep%2Fyii-erp24%2F.git правка закрытия смены --- diff --git a/erp24/forms/timetable/StartForm.php b/erp24/forms/timetable/StartForm.php index b7ad9178..e9580dca 100755 --- a/erp24/forms/timetable/StartForm.php +++ b/erp24/forms/timetable/StartForm.php @@ -167,20 +167,20 @@ class StartForm extends Model if (!$plan) { $this->addError('plan_id', 'Неправильный номер записи плана'); } - if (!$plan->isWorkSlot()) { + if (isset($plan) && !$plan->isWorkSlot()) { $this->addError('plan_id', 'Нерабочий день по плану'); } - if ($this->date != $plan->date) { + if (isset($plan) && $this->date != $plan->date) { $this->addError('date', 'Дата открытия не совпадает с планом'); } $targetAdminId = $this->admin_id ?: $this->replaced_admin_id; - if ($targetAdminId != $plan->admin_id) { + if (isset($plan) && $targetAdminId != $plan->admin_id) { $this->addError($this->replaced_admin_id ? 'replaced_admin_id' : 'admin_id', 'Выбран неправильный пользователь в плане'); } - if ($this->d_id != $plan->d_id) { + if (isset($plan) && $this->d_id != $plan->d_id) { $this->addError('d_id', 'Выбранная должность не совпадает с планом'); } - if ($this->date != $plan->date) { + if (isset($plan) && $this->date != $plan->date) { $this->addError('date', 'Дата не совпадает с планом'); } }],