Merge branch 'main' into feat/festivos-calendar

This commit is contained in:
amazuecos
2025-04-27 19:30:31 +02:00
4 changed files with 42 additions and 7 deletions

View File

@ -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()])

View File

@ -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
{

View File

@ -0,0 +1,30 @@
<table>
<tr class="encuadernacion">
<th >Encuadernacion</th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50">Sobrecubierta</th>
<th class="cell-50">Guardas</th>
<th class="cell-50">Retractilado</th>
<th class="cell-50">Marcapáginas</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td></td>
<td></td>
<td></td>
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td>
<td><?= $presupuesto->guardas ? "SI" : "NO" ?></td>
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>
</tr>
<?php endif; ?>
</table>

View File

@ -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 "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>";
echo "<br><span style='color:red'>$error_message</span>";
// echo "<br><span style='color:red'>$error_message</span>";
}
?>
<?php if (count($encuadernaciones) > 0): ?>