mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
fix update pedido espera update
This commit is contained in:
@ -90,7 +90,6 @@ class ProductionService extends BaseService
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
|
||||
return $this;
|
||||
} catch (\Throwable $th) {
|
||||
dd($orden_trabajo_id);
|
||||
throw $th;
|
||||
}
|
||||
}
|
||||
@ -141,10 +140,10 @@ class ProductionService extends BaseService
|
||||
];
|
||||
$id = $this->otModel->insert($data);
|
||||
$this->init($id);
|
||||
$this->updatePedidoEspera();
|
||||
$this->storeOrdenTrabajoUsers();
|
||||
$this->storeOrdenTrabajoDates();
|
||||
$this->storeAllTareas();
|
||||
$this->updatePedidoEspera();
|
||||
return $this->ot;
|
||||
}
|
||||
|
||||
@ -177,6 +176,24 @@ class ProductionService extends BaseService
|
||||
"orden_trabajo_id" => $this->ot->id,
|
||||
]);
|
||||
}
|
||||
public function reInsertOrdenTrabajoUsers(): int|bool|string
|
||||
{
|
||||
$status = false;
|
||||
if($this->otUser->where('orden_trabajo_id',$this->ot->id)->countAllResults() == 0)
|
||||
{
|
||||
$status = $this->storeOrdenTrabajoUsers();
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
public function reInsertOrdenTrabajoDates(): int|bool|string
|
||||
{
|
||||
$status = false;
|
||||
if($this->otDate->where('orden_trabajo_id',$this->ot->id)->countAllResults() == 0)
|
||||
{
|
||||
$status = $this->storeOrdenTrabajoDates();
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
protected function storeAllTareas()
|
||||
{
|
||||
$this->storeOrdenTrabajoTareas();
|
||||
@ -757,8 +774,8 @@ class ProductionService extends BaseService
|
||||
{
|
||||
$result = [];
|
||||
$otDate = $this->otDate->where('orden_trabajo_id', $this->ot->id)
|
||||
->set([$data['name'] => $data[$data['name']]])
|
||||
->update($data);
|
||||
->set($data['name'],$data[$data['name']])
|
||||
->update();
|
||||
$this->otDate->updateUserDateMap($this->ot->id, $data);
|
||||
$ot_users = $this->ot->users();
|
||||
if (isset($this->ordenTrabajoConfig->DATE_USER_MAPPING[$data["name"]])) {
|
||||
@ -1063,7 +1080,7 @@ class ProductionService extends BaseService
|
||||
$status = false;
|
||||
$presupuestoFiles = $this->presupuesto->files();
|
||||
if (count($presupuestoFiles) == 0) {
|
||||
$status = $this->otModel->update($this->ot->id, ['pedido_espera' => true]);
|
||||
$status = $this->otModel->update($this->ot->id, ['is_pedido_espera' => true]);
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user