mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
fix ot
This commit is contained in:
@ -188,6 +188,7 @@ class ProductionService extends BaseService
|
||||
$this->setPedido($pedido);
|
||||
$this->defaultMaquinaCorte = $this->maquinaModel->where('nombre', $this->defaultMaquinaCorteName)->first();
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
|
||||
$this->updateProgress();
|
||||
return $this;
|
||||
} catch (\Throwable $th) {
|
||||
throw $th;
|
||||
@ -305,6 +306,7 @@ class ProductionService extends BaseService
|
||||
$status = false;
|
||||
if ($this->otDate->where('orden_trabajo_id', $this->ot->id)->countAllResults() == 0) {
|
||||
$status = $this->storeOrdenTrabajoDates();
|
||||
$this->resetAllTareas();
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
@ -1266,7 +1268,7 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $pedidoUserDates;
|
||||
}
|
||||
public function getTiempoProcesamientoHHMM(): string
|
||||
public function getTiempoProcesamientoHHMM(): ?string
|
||||
{
|
||||
$time_tareas_seconds = array_map(fn($q) => $q->tiempo_estimado ?? 0, $this->ot->tareas());
|
||||
$seconds = array_sum($time_tareas_seconds);
|
||||
@ -1303,15 +1305,18 @@ class ProductionService extends BaseService
|
||||
$status = false;
|
||||
$total = count($userDates) + count($pedidoUserDates);
|
||||
if ($this->ot->estado != "F") {
|
||||
foreach ($userDates as $key => $value) {
|
||||
if ($this->ot->dates()->{$key} != null) $fill_dates++;
|
||||
}
|
||||
foreach ($pedidoUserDates as $key => $value) {
|
||||
if ($this->pedido->{$key} != null) $fill_dates++;
|
||||
}
|
||||
if ($this->ot->dates()) {
|
||||
|
||||
$progreso = (float) $fill_dates / $total * 100;
|
||||
$status = $this->otModel->update($this->ot->id, ["progreso" => round($progreso, 2)]);
|
||||
foreach ($userDates as $key => $value) {
|
||||
if ($this->ot->dates()->{$key} != null) $fill_dates++;
|
||||
}
|
||||
foreach ($pedidoUserDates as $key => $value) {
|
||||
if ($this->pedido->{$key} != null) $fill_dates++;
|
||||
}
|
||||
|
||||
$progreso = (float) $fill_dates / $total * 100;
|
||||
$status = $this->otModel->update($this->ot->id, ["progreso" => round($progreso, 2)]);
|
||||
}
|
||||
} else {
|
||||
$status = $this->otModel->update($this->ot->id, ["progreso" => 100]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user