Update WorkorderBaseController.php

This commit is contained in:
Luca Haid
2025-11-12 12:55:55 +00:00
parent 63e78489f3
commit 0b88c73bcf

View File

@@ -173,15 +173,16 @@ foreach ($newPreorders as $preorder) {
if ($existingWorkorder) {
if ($existingWorkorder->status === 'archived') {
$oldStatus = $existingWorkorder->status;
WorkorderModel::update($existingWorkorder->id, [
'status' => 'new',
'companyId' => null,
'civilEngineeringCompanyId' => null,
'deadlineDate' => null,
'appointmentDate' => null,
'clusterId' => $preorder->preordercampaign_id,
]);
$new = (array) $existingWorkorder;
$new['status'] = 'new';
$new['companyId'] = null;
$new['civilEngineeringCompanyId'] = null;
$new['deadlineDate'] = null;
$new['appointmentDate'] = null;
$new['clusterId'] = $preorder->preordercampaign_id;
WorkorderModel::update($new);
WorkorderJournalModel::create([
'workorderId' => $existingWorkorder->id,