fix show form cosido in ot task

This commit is contained in:
amazuecos
2025-05-05 07:53:36 +02:00
parent 058857e51b
commit 46176adc70
6 changed files with 21 additions and 26 deletions

View File

@ -873,7 +873,7 @@ class ProductionService extends BaseService
"tareas_encuadernacion" => $this->tareas_encuadernacion(),
"tareas_preimpresion" => $this->tareas_preimpresion(),
"tareas_impresion" => $this->tareas_impresion(),
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMMSS(),
"tiempo_total" => $this->getTiempoTotalTareas(),
"statusColor" => $this->getOtColorStatus(),
"tareaCosido" => $this->getTareaCosido(),
@ -902,8 +902,8 @@ class ProductionService extends BaseService
"peso_unidad" => $logistica_data["peso_unidad"],
"peso_pedido" => $logistica_data["peso_pedido"],
"imposicion" => $this->getImposicionTareaImpresion(),
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
"tiempo_impresion" => $this->getTiempoTareasImpresionHHMM(),
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMMSS(),
"tiempo_impresion" => $this->getTiempoTareasImpresionHHMMSS(),
"colors" => $this->getPdfColors(),
"isPOD" => $this->isPOD,
"uvi" => $this->getUVI(),
@ -1435,17 +1435,17 @@ class ProductionService extends BaseService
}
return $pedidoUserDates;
}
public function getTiempoProcesamientoHHMM(): ?string
public function getTiempoProcesamientoHHMMSS(): ?string
{
try {
$time_tareas_seconds = array_map(fn($q) => $q->tiempo_estimado ?? 0, $this->ot->tareas());
$seconds = array_sum($time_tareas_seconds);
return float_seconds_to_hhmm_string($seconds);
return float_seconds_to_hhmmss_string($seconds);
} catch (\Throwable $th) {
return '00:00';
return '00:00:00';
}
}
public function getTiempoTareasImpresionHHMM(): string
public function getTiempoTareasImpresionHHMMSS(): string
{
try {
$tareas_impresion = $this->ot->tareas_impresion();
@ -1455,7 +1455,7 @@ class ProductionService extends BaseService
$tiempo_seconds += $tarea->tiempo_estimado;
}
}
return float_seconds_to_hhmm_string($tiempo_seconds);
return float_seconds_to_hhmmss_string($tiempo_seconds);
} catch (\Throwable $th) {
return '00:00';
}
@ -1845,10 +1845,10 @@ class ProductionService extends BaseService
public function cosido(): bool
{
$flag = false;
$manipulados = $this->presupuesto->manipulados();
foreach ($manipulados as $key => $manipulado) {
$tarifa_manipulado = $manipulado->tarifa();
if ($tarifa_manipulado->isCosido()) {
$encuadernaciones = $this->presupuesto->encuadernaciones();
foreach ($encuadernaciones as $key => $encuadernacion) {
$tarifaEncuadernacionEntity = $encuadernacion->tarifa();
if ($tarifaEncuadernacionEntity->isCosido()) {
$flag = true;
break;
}