diff --git a/ci4/app/Controllers/Produccion/Ordentrabajo.php b/ci4/app/Controllers/Produccion/Ordentrabajo.php index 45aa3a7d..bc1286cf 100755 --- a/ci4/app/Controllers/Produccion/Ordentrabajo.php +++ b/ci4/app/Controllers/Produccion/Ordentrabajo.php @@ -242,7 +242,7 @@ class Ordentrabajo extends BaseController { $logo = config(LogoImpresion::class); - $q = $this->otModel->getDatatableQuery()->where("ferro_ok_at", null); + $q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro',1)->where("ferro_ok_at", null); // return $this->response->setJSON($q->get()->getResultArray()); return DataTable::of($q) ->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()]) @@ -257,7 +257,7 @@ class Ordentrabajo extends BaseController { $logo = config(LogoImpresion::class); - $q = $this->otModel->getDatatableQuery()->where("ferro_ok_at is NOT NULL", NULL, FALSE); + $q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro',1)->where("ferro_ok_at is NOT NULL", NULL, FALSE); // return $this->response->setJSON($q->get()->getResultArray()); return DataTable::of($q) ->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()]) 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 { diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/default.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/default.php new file mode 100644 index 00000000..de0a6374 --- /dev/null +++ b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/default.php @@ -0,0 +1,30 @@ + + + + + + + + + + + + 0): ?> + $value): ?> + + + + + + + + + + + + + + + + +
EncuadernacionSobrecubiertaGuardasRetractiladoMarcapáginas
tarifa()->nombre ?>hasSobrecubierta() ? "SI" : "NO" ?>guardas ? "SI" : "NO" ?>retractilado ? "SI" : "NO" ?>marcapaginas ? "SI" : "NO" ?>
Sin encuadernación
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php b/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php index 4ba6a8c3..0d1fb1f8 100755 --- a/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php +++ b/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php @@ -335,12 +335,13 @@ $settings = $session->get('settings'); if ($encuadernacion_code) { echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php"); } else { - throw new Exception('No existe código de encuadernación.'); + echo view("/themes/vuexy/pdfs/encuadernados/default.php"); } } catch (\Throwable $th) { $error_message = $th->getMessage(); + echo view("/themes/vuexy/pdfs/encuadernados/default.php"); echo "No se ha podido renderizar la tabla de encuadernación"; - echo "
$error_message"; + // echo "
$error_message"; } ?> 0): ?>