From 31a12ff343cf75ec24857aafe98a1a307e884873 Mon Sep 17 00:00:00 2001 From: amazuecos Date: Sun, 27 Apr 2025 19:26:02 +0200 Subject: [PATCH] try catch getTiempoProcesamientoHHMM --- ci4/app/Services/ProductionService.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index 2c10a9d2..89babdd5 100755 --- a/ci4/app/Services/ProductionService.php +++ b/ci4/app/Services/ProductionService.php @@ -1353,9 +1353,13 @@ class ProductionService extends BaseService } public function getTiempoProcesamientoHHMM(): ?string { - $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); + 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); + } catch (\Throwable $th) { + return '00:00'; + } } public function getTiempoTareasImpresionHHMM(): string {