tablas encuadernacion ot pdf

This commit is contained in:
amazuecos
2025-04-27 08:20:35 +02:00
parent 96bd24ae8b
commit 45e41c77e4
15 changed files with 548 additions and 198 deletions

View File

@ -65,7 +65,7 @@ class OrdenTrabajo extends BaseConfig
["bg" => "yellow", "color" => "black"],
["bg" => "purple", "color" => "white"],
["bg" => "orange", "color" => "white"],
["bg" => "blue", "color" => "black"],
["bg" => "blue", "color" => "white"],
["bg" => "pink", "color" => "black"],
["bg" => "#FFFFFF", "color" => "black"],
];

View File

@ -194,39 +194,75 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
return $m->find($this->attributes['tarifa_impresion_id']);
}
public function get_impresion_logo(){
public function get_impresion_logo()
{
$logo = config(LogoImpresion::class);
return $logo->get_logo_path($this->attributes["tipo"]);
}
public function get_nombre_tarea() : ?string
public function get_nombre_tarea(): ?string
{
$nombre = null;
$impresion_bn = ["lp_bn","lp_bnhq","lp_rot_bn"];
$impresion_color = ["lp_color","lp_colorhq","lp_rot_color"];
$impresion_bn = ["lp_bn", "lp_bnhq", "lp_rot_bn"];
$impresion_color = ["lp_color", "lp_colorhq", "lp_rot_color"];
$impresion_cubierta = ["lp_cubierta"];
$impresion_guardas = ["lp_guardas"];
$impresion_sobrecubierta = ["lp_sobrecubierta"];
$is_bn = in_array($this->attributes["tipo"],$impresion_bn);
$is_color = in_array($this->attributes["tipo"],$impresion_color);
$is_impresion_cubierta = in_array($this->attributes["tipo"],$impresion_cubierta);
$is_impresion_guarda = in_array($this->attributes["tipo"],$impresion_guardas);
$is_impresion_sobrecubierta = in_array($this->attributes["tipo"],$impresion_sobrecubierta);
$is_bn = in_array($this->attributes["tipo"], $impresion_bn);
$is_color = in_array($this->attributes["tipo"], $impresion_color);
$is_impresion_cubierta = in_array($this->attributes["tipo"], $impresion_cubierta);
$is_impresion_guarda = in_array($this->attributes["tipo"], $impresion_guardas);
$is_impresion_sobrecubierta = in_array($this->attributes["tipo"], $impresion_sobrecubierta);
if($is_bn) $nombre ="Impresión B/N";
if($is_color) $nombre ="Impresión color";
if($is_impresion_cubierta) $nombre ="Impresión cubierta";
if($is_impresion_guarda) $nombre ="Impresión guarda";
if($is_impresion_sobrecubierta) $nombre ="Impresión sobrecubierta";
if ($is_bn) $nombre = "Impresión B/N";
if ($is_color) $nombre = "Impresión color";
if ($is_impresion_cubierta) $nombre = "Impresión cubierta";
if ($is_impresion_guarda) $nombre = "Impresión guarda";
if ($is_impresion_sobrecubierta) $nombre = "Impresión sobrecubierta";
return $nombre;
}
public function isRotativa() : bool
{
return in_array($this->attributes['tipo'],['lp_rot_color','lp_rot_bn']);
public function isGuarda(): bool
{
return in_array($this->attributes["tipo"], ["lp_guardas"]);
}
public function isColor():bool {
return in_array($this->attributes['tipo'],['lp_color','lp_colorhq','lp_rot_color']);
public function isCubierta(): bool
{
return in_array($this->attributes["tipo"], ["lp_cubierta"]);
}
public function isSobreCubierta(): bool
{
return in_array($this->attributes["tipo"], ["lp_sobrecubierta"]);
}
public function isRotativa(): bool
{
return in_array($this->attributes['tipo'], ['lp_rot_color', 'lp_rot_bn']);
}
public function isColor(): bool
{
return in_array($this->attributes['tipo'], ['lp_color', 'lp_colorhq', 'lp_rot_color']);
}
public function isBN(): bool
{
return in_array($this->attributes['tipo'], ["lp_bn", "lp_bnhq", "lp_rot_bn"]);
}
public function tinta(): string
{
$tinta = "";
if ($this->isCubierta()) {
$paginas = $this->attributes['paginas'];
if ($paginas / 2 == 1) {
$tinta = '4/0';
}
if ($paginas / 2 == 2) {
$tinta = '4/4';
}
} elseif ($this->isColor()) {
$tinta = '4/4';
} elseif ($this->isBN()) {
$tinta = '4/0';
}
return $tinta;
}
}

View File

@ -8,7 +8,7 @@ if (auth()->user()->can('catalogo.menu')) {
<li class="menu-item">
<a href="javascript:void(0);" class="menu-link menu-toggle">
<i class="menu-icon tf-icons ti ti-book"></i>
<?= lang("App.menu_catalogo") ?>
<div><?= lang("App.menu_catalogo") ?></div>
</a>
<ul class="menu-sub">
<?php if (auth()->user()->can('catalogo.menu')) { ?>

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"></th>
<th class="cell-50"></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></td>
<td></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

@ -0,0 +1,30 @@
<table>
<tr class="encuadernacion">
<th >Encuadernacion</th>
<th class="cell-50">Solapas</th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50"></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><?= $presupuesto->solapas ? "SI ($presupuesto->solapas_ancho mm.)" : "NO" ?></td>
<td></td>
<td></td>
<td></td>
<td></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

@ -0,0 +1,28 @@
<table>
<tr class="encuadernacion">
<th class="cell-50">Encuadernacion</th>
<th class="cell-50">Tipo</th>
<th class="cell-50">Color</th>
<th class="cell-50">Plakenes</th>
<th class="cell-50">Plakene</th>
<th class="cell-50">Externo</th>
<th class="cell-50">Retractilado</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></td>
<td></td>
<td><?= $presupuesto->retractilado ? "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

@ -0,0 +1,30 @@
<table>
<tr class="encuadernacion">
<th>Encuadernacion</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Pliegos</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><?=$linea_impresion->pliegos?></td>
<td><?=$linea_impresion->pliegos?></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

@ -0,0 +1,30 @@
<table>
<tr class="encuadernacion">
<th>Encuadernacion</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Solapas</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><?=$linea_impresion->pliegos?></td>
<td><?=$linea_impresion->pliegos?></td>
<td><?= $presupuesto->solapas ? "SI ($presupuesto->solapas_ancho mm.)" : "NO" ?></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

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

@ -0,0 +1,30 @@
<table>
<tr class="encuadernacion">
<th >Encuadernacion</th>
<th class="cell-50">Solapas</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><?= $presupuesto->solapas ? "SI ($presupuesto->solapas_ancho mm.)" : "NO" ?></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

@ -0,0 +1,36 @@
<table>
<tr>
<th class="encuadernacion">Encuadernacion</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Guardas</th>
<th class="cell-50">Guardas Impresion</th>
<th class="cell-50">Cabezada</th>
<th class="cell-50">Lomo</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td><?= $linea_impresion->pliegos ?></td>
<td><?= $linea_impresion->pliegos ?></td>
<td></td>
<td></td>
<td>Color/NO</td>
<td>Recto/Redondo</td>
</tr>
<tr>
<td class="encuadernacion" colspan="1">Sobrecubierta</td>
<td style="color:red" colspan="2"><?= $linea_impresion->isSobreCubierta() ? "SI" : "NO" ?></td>
<td class="encuadernacion">Retractilado</td>
<td style="color:red"><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td class="encuadernacion">Marcapáginas</td>
<td style="color:red"><?= $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

@ -0,0 +1,30 @@
<table>
<tr class="encuadernacion">
<th >Encuadernacion</th>
<th class="cell-50">Guardas</th>
<th class="cell-50">Guardas Imp.</th>
<th class="cell-50">Cabezada</th>
<th class="cell-50">Lomo</th>
<th class="cell-50">Sobrecubierta</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></td>
<td></td>
<td></td>
<td></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>
</tr>
<?php endif; ?>
</table>

View File

@ -0,0 +1,29 @@
<table>
<caption>
WIO
</caption>
<tr class="encuadernacion">
<th class="cell-50">Encuadernacion</th>
<th class="cell-50">Color</th>
<th class="cell-50">Plakenes</th>
<th class="cell-50">Plakene</th>
<th class="cell-50">Externo</th>
<th class="cell-50">Retractilado</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></td>
<td><?= $presupuesto->retractilado ? "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

@ -156,6 +156,12 @@ $settings = $session->get('settings');
<div class="row">
<div class="col-8">
<table class="h-50">
<tr>
<th>IDSK</th>
<td class="t-cell">
</td>
</tr>
<tr>
<th>CLIENTE</th>
<td class="t-cell">
@ -229,9 +235,9 @@ $settings = $session->get('settings');
<th>Tiempo</th>
</tr>
<tr>
<td><?= $presupuesto->paginas * $presupuesto->tirada ?></td>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
<td><?= $presupuesto->tirada ?> </td>
<td>??</td>
<td><?= $linea_impresion->tinta() ?></td>
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
<td><?= $linea_impresion->rotativa_clicks_total ?></td>
@ -275,7 +281,7 @@ $settings = $session->get('settings');
<th>Tiempo</th>
</tr>
<tr>
<td>??</td>
<td><?= $linea_cubierta->tinta() ?></td>
<td><?= $presupuesto->tirada ?></td>
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
@ -302,46 +308,41 @@ $settings = $session->get('settings');
<div class="row mb-2">
<div class="section-title encuadernacion">ENCUADERNACIÓN</div>
<div class="col-12">
<div class="col-1 w-10 mb-2 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<span class="fs-bold"><?= isset($encuadernaciones[0]) ? $encuadernaciones[0]->tarifa()->code ?? "?" : "?" ?></span>
</div>
<table>
<tr>
<th class="t-header" style="width: 10%;">Plastificado</th>
<td class="t-cell text-center"><?= $acabados[0]->tarifa()->nombre ?></td>
<th class="t-header" style="width: 10%;">UVI</th>
<td class="t-cell text-center"> <?= $uvi ? $uvi->code : "" ?> </td>
<th class="t-header" style="width: 10%;">Máquina</th>
<td class="t-cell text-center"><?= implode("/", array_map(fn($q) => $q->nombre, $acabados[0]->maquinas())) ?> </td>
<th class="t-header " style="width: 10%;">Operario</th>
<td class="t-cell text-center"><?= $ot->users()?->plastificado_by?->getFullName() ?? null ?> </td>
<td class="w-10 encuadernacion">Plastificado</td>
<td><?= $acabados[0]->tarifa()->nombre ?></td>
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">UVI</td>
<td style="color:red;width:100px" class="bg-encuadernacion"> <?= $uvi ? 'SI' : "NO" ?> </td>
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">EXTERNO:</td>
<td class="bg-encuadernacion" style="width: 100px;"></td>
</tr>
</table>
<table>
<tr>
<th>Encuadernacion</th>
<th>Solapas</th>
<th>Sobrecubierta</th>
<th>Plegado</th>
<th>Guardas</th>
<th>Retractilado</th>
<th>Marcapáginas</th>
<td class="text-start" colspan="2">Meter datos de solapas y preparación guillotina</td>
<td></td>
<td></td>
<td class="t-header">CORTE PIE:</td>
<td></td>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr>
<td><?= $value->tarifa()->nombre ?></td>
<td><?= $presupuesto->solapas ? "SI" : "NO" ?></td>
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td>
<td>_____<?= " " . lang("Produccion.pliegos_de") . " " ?>_____</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>
<td colspan="7">Sin encuadernación</td>
</tr>
<?php endif; ?>
</table>
<?php
$encuadernacion_code = isset($encuadernaciones[0]) ? $encuadernaciones[0]->tarifa()->code : null;
try {
if ($encuadernacion_code) {
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php");
} else {
throw new Exception('No existe código de encuadernación.');
}
} catch (\Throwable $th) {
$error_message = $th->getMessage();
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>";
}
?>
<?php if (count($encuadernaciones) > 0): ?>
<div class="comments">