Features:

- Prototipo PDF
 - Ferro PDF
 - Ferro OK fecha cambiado a Ferro/Prototipo OK
 - Comentarios para orden,impresion,cubierta,encuadernacion y logistica
 - Migración para comentarios
 - Tarifas acabado migraciones con campos para identificar mejor si es plastificado,plakene,retractilado y el tipo de cada uno
This commit is contained in:
amazuecos
2025-04-30 09:23:37 +02:00
parent 36c9227586
commit cf4c4df80a
16 changed files with 1343 additions and 375 deletions

View File

@ -783,6 +783,8 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
* PDF
*========================**/
$routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1');
$routes->get('pdf/ferro/(:num)', 'Ordentrabajo::get_ferro_pdf/$1');
$routes->get('pdf/prototipo/(:num)', 'Ordentrabajo::get_prototipo_pdf/$1');
$routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1');
$routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
$routes->get('select/maquina/rotativa', 'Ordentrabajo::select_maquina_planning_rot');

View File

@ -313,6 +313,14 @@ class Ordentrabajo extends BaseController
{
return $this->produccionService->init($orden_trabajo_id)->getPdf();
}
public function get_ferro_pdf($orden_trabajo_id)
{
return $this->produccionService->init($orden_trabajo_id)->getFerroPdf();
}
public function get_prototipo_pdf($orden_trabajo_id)
{
return $this->produccionService->init($orden_trabajo_id)->getPrototipoPdf();
}
public function upload_orden_trabajo_portada()
{
try {

View File

@ -0,0 +1,39 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AlterOrdenesTrabajoAddCommentColumns extends Migration
{
protected array $COLUMNS = [
'comment_interior' => [
'type' => 'LONGTEXT',
'null' => true
],
'comment_cubierta' => [
'type' => 'LONGTEXT',
'null' => true
],
'comment_encuadernacion' => [
'type' => 'LONGTEXT',
'null' => true
],
'comment_logistica' => [
'type' => 'LONGTEXT',
'null' => true
],
];
public function up()
{
$this->forge->addColumn('ordenes_trabajo',$this->COLUMNS);
}
public function down()
{
$this->forge->dropColumn('ordenes_trabajo',array_keys($this->COLUMNS));
}
}

View File

@ -30,6 +30,10 @@ class OrdenTrabajoEntity extends Entity
"progreso" => 0.00,
"estado" => "I",
"comentarios" => null,
"comment_interior"=> null,
"comment_cubierta"=> null,
"comment_encuadernacion"=> null,
"comment_logistica"=> null,
"revisar_formato" => null,
"revisar_lomo" => null,
"revisar_solapa" => null,
@ -52,7 +56,11 @@ class OrdenTrabajoEntity extends Entity
"tipo_entrada" => "string",
"progreso" => "float",
"estado" => "string",
"comentarios" => "string",
"comentarios" => "?string",
"comment_interior"=> "?string",
"comment_cubierta"=> "?string",
"comment_encuadernacion"=> "?string",
"comment_logistica"=> "?string",
"revisar_formato" => "bool",
"revisar_lomo" => "bool",
"revisar_solapa" => "bool",

View File

@ -48,7 +48,7 @@ return [
"finalizadas" => "Finalizadas",
"pendiente_ferro" => "Ferro pendiente",
"pendientes" => "Pendientes",
"ferro_ok" => "Ferro ok",
"ferro_ok" => "Ferro/Prototipo ok",
"envio" => "Envío",
"ferro" => "Ferro",
"ot" => "Orden trabajo",
@ -80,6 +80,7 @@ return [
"preview_pdf" => "Previsualizar PDF",
"imprimir_codigo_safekat" => "Imprimir código SAFEKAT",
"imprimir_ferro" => "Imprimir ferro",
"imprimir_prototipo" => "Prototipo",
"planning_rotativa" => "Planificación rotativa",
"planning_plana" => "Planificación plana",
"solapa" => "Solapa",
@ -144,6 +145,12 @@ return [
'print_label' => "Imprimir etiqueta",
'click_init' => "Clicks al inicio",
'click_end' => "Clicks al final",
"comentarios" => "Comentarios",
"comentariosOt" => "Comentarios orden",
"comentariosImpresionInterior" => "Comentarios interior",
"comentariosCubierta" => "Comentarios cubierta",
"comentariosEncuadernacion" => "Comentarios encuadernación",
"comentariosLogistica" => "Comentarios logística",
];

View File

@ -25,6 +25,10 @@ class OrdenTrabajoModel extends Model
"progreso",
"estado",
"comentarios",
"comment_interior",
"comment_cubierta",
"comment_encuadernacion",
"comment_logistica",
"revisar_formato",
"revisar_lomo",
"revisar_solapa",

View File

@ -585,6 +585,14 @@ class ProductionService extends BaseService
{
return view("themes/vuexy/pdfs/orden_trabajo", $this->getDataPdf());
}
public function getFerroPdf()
{
return view("themes/vuexy/pdfs/ferro", $this->getDataPdf());
}
public function getPrototipoPdf()
{
return view("themes/vuexy/pdfs/prototipo", $this->getDataPdf());
}
/**
* Query para mostrar en datatable
*

View File

@ -1,6 +1,168 @@
<div class="accordion accordion-bordered mt-3" id="accordionComentarios">
<div class="card accordion-item active">
<h2 class="accordion-header" id="headingOne">
<button type="button" class="accordion-button" data-bs-toggle="collapse"
data-bs-target="#accordionComentariosTip" aria-expanded="false"
aria-controls="accordionComentariosTip">
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
<span><i class="ti-quote ti-md ti"></i></span>
<h4> <?= lang('Produccion.comentarios') ?> </h4>
</div>
</button>
</h2>
<div class="cold-md-12 mt-3">
<!-- Comment text area-->
<label for="ot-comment" class="form-label"><h4><?= @lang("Produccion.comments") ?></h4></label>
<textarea rows=5 cols="10" type="text" class="form-control w-100" name="comentarios" id="ot-comment"></textarea>
</div>
<div id="accordionComentariosTip" class="accordion-collapse collapse show"
data-bs-parent="#accordionComentarios">
<div class="accordion-body">
<div class="nav-align-top mb-4">
<ul class="nav nav-pills mb-3" role="tablist">
<li class="nav-item">
<button
type="button"
class="nav-link active"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-ot"
aria-controls="comentarios-ot"
aria-selected="true">
<?= lang("Produccion.comentariosOt") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-interior"
aria-controls="comentarios-interior"
aria-selected="true">
<?= lang("Produccion.comentariosImpresionInterior") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-cubierta"
aria-controls="comentarios-cubierta"
aria-selected="false">
<?= lang("Produccion.comentariosCubierta") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-encuadernacion"
aria-controls="comentarios-encuadernacion"
aria-selected="false">
<?= lang("Produccion.comentariosEncuadernacion") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-logistica"
aria-controls="comentarios-logiscita"
aria-selected="false">
<?= lang("Produccion.comentariosLogistica") ?>
</button>
</li>
</ul>
<div class="tab-content border border-container">
<div class="tab-pane fade show active" id="comentarios-ot" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="comentarios"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->comentarios ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-interior" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="comment_interior"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->comment_interior ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-cubierta" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="comment_cubierta"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->comment_cubierta ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-encuadernacion" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="comment_encuadernacion"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->comment_encuadernacion ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-logistica" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="comment_logistica"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->comment_logistica ?></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- //.accordion-body -->
</div> <!-- //.accordion-collapse -->
</div> <!-- //.accordion-item -->
</div> <!-- //.accordion -->

View File

@ -42,9 +42,17 @@
<span class="ti-sm ti ti-truck-delivery me-1"></span>
Pedido
</a>
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
<span class="ti-sm ti ti-file me-1"></span>
PDF</a>
<?php if ($presupuesto->ferro == 1): ?>
<?php if ($ot->dates()->ferro_ok_at != null): ?>
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
<span class="ti-sm ti ti-file me-1"></span>
PDF</a>
<?php endif; ?>
<?php else: ?>
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
<span class="ti-sm ti ti-file me-1"></span>
PDF</a>
<?php endif; ?>
<a type="button" href="<?= route_to('getOrdenTrabajoBarCode', $modelId) ?>" class="btn btn-secondary btn-block mb-1" download><span class="ti-sm ti ti-barcode me-1"></span><?= @lang("Produccion.imprimir_codigo_safekat") ?></a>

View File

@ -45,9 +45,17 @@
href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
<span class="ti-sm ti ti-eye me-1"></span>
<?= @lang("Produccion.preview_pdf") ?></a>
<?php if ($presupuesto->ferro): ?>
<a type="button" class="btn btn-primary btn-block mb-1" target="__blank"
href="<?= "/produccion/ordentrabajo/pdf/ferro/" . $modelId ?>">
<span class="ti-sm ti ti-download me-1"></span>
<?= @lang("Produccion.imprimir_ferro") ?></a>
<?php endif; ?>
<?php if ($presupuesto->prototipo): ?>
<button type="button"
class="btn btn-primary btn-block mb-1 beta"><?= @lang("Produccion.imprimir_ferro") ?></button>
<a type="button" class="btn btn-primary btn-block mb-1" target="__blank"
href="<?= "/produccion/ordentrabajo/pdf/prototipo/" . $modelId ?>">
<span class="ti-sm ti ti-download me-1"></span>
<?= @lang("Produccion.prototipo") ?></a>
<?php endif; ?>
<a type="button" href="<?= route_to('getOrdenTrabajoBarCode', $modelId) ?>"
class="btn btn-secondary btn-block mb-1"

View File

@ -0,0 +1,305 @@
<?php
use CodeIgniter\I18n\Time;
$session = session();
$settings = $session->get('settings');
?>
<!DOCTYPE html>
<html
lang="<?= $session->get('lang') ?>"
data-assets-path="<?= site_url('themes/vuexy/') ?>"
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Icons -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>" />
<!-- Core CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>" />
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/pdf.ot.css') ?>">
<title><?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>]</title>
</head>
<body>
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_FERRO_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
<div class="row">
<div class="col-12 d-flex justify-content-between align-items-center">
<h5><?= $presupuesto->titulo ?></h5>
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
</div>
</div>
</div>
<div class="row mb-2 d-flex flex align-items-stretch">
<div class="col-2">
<?php if ($ot->full_path): ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
<?php else: ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
<?php endif; ?>
</div>
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
<div class="row">
<div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div>
</div>
<div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?>
<strong>POD</strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
<strong>ROTATIVA</strong>
<?php else: ?>
<strong>GENERAL</strong>
<?php endif; ?>
</span>
</div>
</div>
</div>
<div class="row p-2">
<div class="col-3 h-100">
<div class="row px-2 mt-2 h-100">
<table class="h-100 bg-white">
<tr>
<th class="bg-white">IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>PORT.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ACABAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ENCUAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>MANIPUL.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
</table>
</div>
</div>
<div class="col-5">
<div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= $encuadernacionCode ?></strong>
</div>
</div>
<div class="row h-75">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div>
<?php foreach ($acabados as $key => $acabado): ?>
<?php if ($acabado->tarifa()->isUVI()): ?>
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
+ <?= $acabado->tarifa()->code ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
</div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
</div>
</div>
</div>
</div>
</div>
</div>
<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">
<?= $cliente->alias ?>
</td>
</tr>
<tr>
<th>TITULO</th>
<td class="t-cell">
<?= $presupuesto->titulo ?>
</td>
</tr>
<tr>
<th>ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr>
<tr>
<th>PEDIDO CLIENTE</th>
<td class="t-cell"><?= $pedido->id ?></td>
</tr>
</table>
</div>
<div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="col-12">
<div class="imposicion">
<table>
<tr>
<th class="w-50">Imposicion</th>
<td><?= $imposicion?->full_name ?? "" ?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="section-title impresion">IMP. INTERIOR</div>
<div class="col-12">
<div>
<table>
<tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th>
<td class="t-cell text-center"> 1 </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr>
</table>
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Páginas</th>
<th>Ejemplares</th>
<th>Tintas</th>
<th>Formas</th>
<th>Máquina</th>
<th>Clics</th>
<th>Tiempo</th>
</tr>
<tr>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
<td> 1 </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_libro ?></td>
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600 / $presupuesto->tirada) ?></td>
</tr>
<tr>
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
<td colspan="2">
<?php if ($linea_impresion->isRotativa()): ?>
<?= number_format($linea_impresion->rotativa_metros_libro, 2, ',', '.') ?> metros
<?php endif; ?>
</td>
</tr>
</table>
</div>
<div class="comments">
<div class="flex-row impresion">Comentarios impresión interior</div>
<div class="comment-content w-100">
<p>
<?= $ot->comment_interior ?>
</p>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="section-title">LOGISTICA</div>
<div class="col-12">
<table>
<tr>
<th>Peso Unidad</th>
<th>Peso Pedido</th>
<th>Corte Pie</th>
</tr>
<tr>
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
<td><?= $peso_unidad > 1000 ? number_format($peso_unidad / 1000, 2, ',', '.') . " kg" : number_format($peso_unidad, 2, ',', '.') . " gr" ?> </td>
<td>-</td>
</tr>
</table>
<div class="comments">
<div class="flex-row">Comentarios logistica:</div>
<div class="comment-content">
<p>
<?= $ot->comment_logistica ?>
</p>
</div>
</div>
</div>
</div>
<div class="col-md-12 d-flex justify-content-center align-items-center">
<span class="footer">&copy; 2024 SAFEKAT. Todos los derechos reservados.</span>
</div>
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
</body>
</html>

View File

@ -32,378 +32,382 @@ $settings = $session->get('settings');
</head>
<body>
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
<div class="row">
<div class="col-12 d-flex justify-content-between align-items-center">
<h5><?= $presupuesto->titulo ?></h5>
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
</div>
</div>
</div>
<div class="row mb-2 d-flex flex align-items-stretch">
<div class="col-2">
<?php if ($ot->full_path): ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
<?php else: ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
<?php endif; ?>
</div>
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
<div>
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
<div class="row">
<div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div>
</div>
<div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?>
<strong>POD</strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
<strong>ROTATIVA</strong>
<?php else: ?>
<strong>GENERAL</strong>
<?php endif; ?>
</span>
</div>
</div>
</div>
<div class="row p-2">
<div class="col-3 h-100">
<div class="row px-2 d-flex flex justify-content-between align-items-center">
<div class="col-6 w-100 text-center">
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
</div>
</div>
<div class="row px-2 mt-2 h-100">
<table class="h-100 bg-white">
<tr>
<th class="bg-white">IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>PORT.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ACABAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ENCUAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>MANIPUL.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
</table>
</div>
</div>
<div class="col-5">
<div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= $encuadernacionCode ?></strong>
</div>
</div>
<div class="row h-75">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div>
<?php foreach ($acabados as $key => $acabado): ?>
<?php if ($acabado->tarifa()->isUVI()): ?>
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
+ <?= $acabado->tarifa()->code ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
</div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
</div>
</div>
<div class="col-12 d-flex justify-content-between align-items-center">
<h5><?= $presupuesto->titulo ?></h5>
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-8">
<table class="h-50">
<tr>
<th>IDSK</th>
<td class="t-cell">
<div class="row mb-2 d-flex flex align-items-stretch">
<div class="col-2">
<?php if ($ot->full_path): ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
<?php else: ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
</td>
</tr>
<tr>
<th>CLIENTE</th>
<td class="t-cell">
<?= $cliente->alias ?>
</td>
</tr>
<tr>
<th>TITULO</th>
<td class="t-cell">
<?= $presupuesto->titulo ?>
</td>
</tr>
<tr>
<th>ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr>
<tr>
<th>PEDIDO CLIENTE</th>
<td class="t-cell"><?= $pedido->id ?></td>
</tr>
</table>
</div>
<div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="col-12">
<div class="imposicion">
<table>
<tr>
<th class="w-50">Imposicion</th>
<td><?= $imposicion?->full_name ?? "" ?></td>
</tr>
</table>
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
<div class="row">
<div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div>
</div>
<div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?>
<strong>POD</strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
<strong>ROTATIVA</strong>
<?php else: ?>
<strong>GENERAL</strong>
<?php endif; ?>
</span>
</div>
</div>
</div>
<div class="row p-2">
<div class="col-3 h-100">
<div class="row px-2 d-flex flex justify-content-between align-items-center">
<div class="col-6 w-100 text-center">
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
</div>
</div>
<div class="row px-2 mt-2 h-100">
<table class="h-100 bg-white">
<tr>
<th class="bg-white">IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>PORT.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ACABAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ENCUAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>MANIPUL.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
</table>
</div>
</div>
<div class="col-5">
<div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= $encuadernacionCode ?></strong>
</div>
</div>
<div class="row h-75">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div>
<?php foreach ($acabados as $key => $acabado): ?>
<?php if ($acabado->tarifa()->isUVI()): ?>
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
+ <?= $acabado->tarifa()->code ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
</div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="section-title impresion">IMP. INTERIOR</div>
<div class="col-12">
<div>
<table>
<div class="row">
<div class="col-8">
<table class="h-50">
<tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tirada ?> + <?= $presupuesto->merma ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr>
</table>
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Páginas</th>
<th>Ejemplares</th>
<th>Tintas</th>
<th>Formas</th>
<th>Máquina</th>
<th>Clics</th>
<th>Tiempo</th>
<th>IDSK</th>
<td class="t-cell">
</td>
</tr>
<tr>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
<td><?= $presupuesto->tirada ?> </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>
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
<th>CLIENTE</th>
<td class="t-cell">
<?= $cliente->alias ?>
</td>
</tr>
<tr>
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
<td colspan="2">
<?php if ($linea_impresion->isRotativa()): ?>
<?= number_format($linea_impresion->rotativa_metros_total, 2, ',', '.') ?> metros
<?php endif; ?>
<th>TITULO</th>
<td class="t-cell">
<?= $presupuesto->titulo ?>
</td>
</tr>
<tr>
<th>ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr>
<tr>
<th>PEDIDO CLIENTE</th>
<td class="t-cell"><?= $pedido->id ?></td>
</tr>
</table>
</div>
<div class="comments">
<div class="flex-row impresion">Comentarios impresión interior</div>
<div class="comment-content w-100">
<p>
</p>
<br />
<p>
</p>
<div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="col-12">
<div class="imposicion">
<table>
<tr>
<th class="w-50">Imposicion</th>
<td><?= $imposicion?->full_name ?? "" ?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<?php if ($linea_cubierta): ?>
<div class="row mb-2">
<div class="section-title cubierta">IMP. CUBIERTA</div>
<div class="section-title impresion">IMP. INTERIOR</div>
<div class="col-12">
<div>
<table>
<tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tirada ?> + <?= $presupuesto->merma ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr>
</table>
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Páginas</th>
<th>Ejemplares</th>
<th>Tintas</th>
<th>Formas</th>
<th>Máquina</th>
<th>Clics</th>
<th>Tiempo</th>
</tr>
<tr>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
<td><?= $presupuesto->tirada ?> </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>
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
</tr>
<tr>
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
<td colspan="2">
<?php if ($linea_impresion->isRotativa()): ?>
<?= number_format($linea_impresion->rotativa_metros_total, 2, ',', '.') ?> metros
<?php endif; ?>
</td>
</tr>
</table>
</div>
<div class="comments">
<div class="flex-row impresion"><?= lang('Produccion.comentariosImpresionInterior') ?></div>
<div class=" w-100">
<p>
<?= $ot->comment_interior ?>
</p>
</div>
</div>
</div>
</div>
<?php if ($linea_cubierta): ?>
<div class="row mb-2">
<div class="section-title cubierta">IMP. CUBIERTA</div>
<div class="col-12">
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Tintas</th>
<th>Ejemplares</th>
<th>Maquina</th>
<th>Marcapaginas</th>
<th>Tiempo</th>
</tr>
<tr>
<td><?= $linea_cubierta->tinta() ?></td>
<td><?= $presupuesto->tirada ?></td>
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600) ?></td>
</tr>
<tr>
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
</tr>
</table>
<div class="comments">
<div class="flex-row cubierta"><?= lang('Produccion.comentariosCubierta') ?></div>
<div class="">
<p>
<?= $ot->comment_cubierta ?>
</p>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="row">
<div class="section-title encuadernacion">ACABADOS/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"><?= $encuadernacionCode ?></span>
</div>
<table>
<?php foreach ($acabados as $key => $acabado): ?>
<tr>
<td class="w-10 encuadernacion">Plastificado</td>
<td><?= $acabado->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;"><?= $acabado->proveedor() ? $acabado->proveedor()->nombre : "" ?></td>
</tr>
<tr>
<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 endforeach; ?>
</table>
<?php
foreach ($encuadernaciones as $key => $encuadernacion) {
$encuadernacion_code = $encuadernacion->tarifa()->code;
try {
if ($encuadernacion_code) {
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]);
} else {
echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
}
} 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">
<div class="flex-row encuadernacion"><?= lang('Produccion.comentariosEncuadernacion') ?></div>
<div class="">
<p>
<?= $ot->comment_encuadernacion ?>
</p>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div class="row mb-2">
<div class="section-title">LOGISTICA</div>
<div class="col-12">
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Tintas</th>
<th>Ejemplares</th>
<th>Maquina</th>
<th>Marcapaginas</th>
<th>Tiempo</th>
<th>Peso Unidad</th>
<th>Peso Pedido</th>
<th>Cajas</th>
<th>Corte Pie</th>
</tr>
<tr>
<td><?= $linea_cubierta->tinta() ?></td>
<td><?= $presupuesto->tirada ?></td>
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600) ?></td>
</tr>
<tr>
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
<td><?= $peso_pedido > 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> </td>
<td>-</td>
<td>-</td>
</tr>
</table>
<div class="comments">
<div class="flex-row cubierta">Comentarios cubierta</div>
<div class="comment-content">
<div class="flex-row logistica"><?= lang('Produccion.comentariosLogistica') ?></div>
<div class="">
<p>
<?= $ot->comment_logistica ?>
</p>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="row mb-2">
<div class="section-title encuadernacion">ACABADOS/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"><?= $encuadernacionCode ?></span>
</div>
<table>
<?php foreach ($acabados as $key => $acabado): ?>
<tr>
<td class="w-10 encuadernacion">Plastificado</td>
<td><?= $acabado->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;"><?= $acabado->proveedor() ? $acabado->proveedor()->nombre : "" ?></td>
</tr>
<tr>
<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 endforeach; ?>
</table>
<?php
foreach ($encuadernaciones as $key => $encuadernacion) {
$encuadernacion_code = $encuadernacion->tarifa()->code;
try {
if ($encuadernacion_code) {
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]);
} else {
echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
}
} 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">
<div class="flex-row encuadernacion">Comentarios encuadernacion:</div>
<div class="comment-content">
<p>
</p>
</div>
</div>
<?php endif; ?>
<div class="col-md-12 d-flex justify-content-center align-items-center">
<span class="footer">&copy; 2024 SAFEKAT. Todos los derechos reservados.</span>
</div>
</div>
<div class="row mb-2">
<div class="section-title">LOGISTICA</div>
<div class="col-12">
<table>
<tr>
<th>Peso Unidad</th>
<th>Peso Pedido</th>
<th>Cajas</th>
<th>Corte Pie</th>
</tr>
<tr>
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
<td><?= $peso_pedido > 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> </td>
<td>-</td>
<td>-</td>
</tr>
</table>
<div class="comments">
<div class="flex-row">Comentarios logistica:</div>
<div class="comment-content">
<p>
</p>
</div>
</div>
</div>
</div>
<div class="col-md-12 d-flex justify-content-center align-items-center">
<span class="footer">&copy; 2024 SAFEKAT. Todos los derechos reservados.</span>
</div>
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
</div>
</body>
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
</html>

View File

@ -0,0 +1,410 @@
<?php
use CodeIgniter\I18n\Time;
$session = session();
$settings = $session->get('settings');
?>
<!DOCTYPE html>
<html
lang="<?= $session->get('lang') ?>"
data-assets-path="<?= site_url('themes/vuexy/') ?>"
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Icons -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>" />
<!-- Core CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>" />
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/pdf.ot.css') ?>">
<title><?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>]</title>
</head>
<body>
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_PROTOTIPO_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
<div class="row">
<div class="col-12 d-flex justify-content-between align-items-center">
<h5><?= $presupuesto->titulo ?></h5>
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
</div>
</div>
</div>
<div class="row mb-2 d-flex flex align-items-stretch">
<div class="col-2">
<?php if ($ot->full_path): ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
<?php else: ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
<?php endif; ?>
</div>
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
<div class="row">
<div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div>
</div>
<div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?>
<strong>POD</strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
<strong>ROTATIVA</strong>
<?php else: ?>
<strong>GENERAL</strong>
<?php endif; ?>
</span>
</div>
</div>
</div>
<div class="row p-2">
<div class="col-3 h-100">
<div class="row px-2 d-flex flex justify-content-between align-items-center">
<div class="col-6 w-100 text-center">
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
</div>
</div>
<div class="row px-2 mt-2 h-100">
<table class="h-100 bg-white">
<tr>
<th class="bg-white">IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>PORT.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ACABAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ENCUAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>MANIPUL.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
</table>
</div>
</div>
<div class="col-5">
<div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= $encuadernacionCode ?></strong>
</div>
</div>
<div class="row h-75">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div>
<?php foreach ($acabados as $key => $acabado): ?>
<?php if ($acabado->tarifa()->isUVI()): ?>
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
+ <?= $acabado->tarifa()->code ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
</div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
</div>
</div>
</div>
</div>
</div>
</div>
<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">
<?= $cliente->alias ?>
</td>
</tr>
<tr>
<th>TITULO</th>
<td class="t-cell">
<?= $presupuesto->titulo ?>
</td>
</tr>
<tr>
<th>ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr>
<tr>
<th>PEDIDO CLIENTE</th>
<td class="t-cell"><?= $pedido->id ?></td>
</tr>
</table>
</div>
<div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="col-12">
<div class="imposicion">
<table>
<tr>
<th class="w-50">Imposicion</th>
<td><?= $imposicion?->full_name ?? "" ?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="section-title impresion">IMP. INTERIOR</div>
<div class="col-12">
<div>
<table>
<tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tirada/$presupuesto->tirada ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr>
</table>
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Páginas</th>
<th>Ejemplares</th>
<th>Tintas</th>
<th>Formas</th>
<th>Máquina</th>
<th>Clics</th>
<th>Tiempo</th>
</tr>
<tr>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
<td><?= $presupuesto->tirada / $presupuesto->tirada ?> </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_libro ?></td>
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600 / $presupuesto->tirada) ?></td>
</tr>
<tr>
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
<td colspan="2">
<?php if ($linea_impresion->isRotativa()): ?>
<?= number_format($linea_impresion->rotativa_metros_libro, 2, ',', '.') ?> metros
<?php endif; ?>
</td>
</tr>
</table>
</div>
<div class="comments">
<div class="flex-row impresion"><?= lang('Produccion.comentariosImpresionInterior') ?></div>
<div class="comment-content w-100">
<p>
<?= $ot->comment_interior ?>
</p>
</div>
</div>
</div>
</div>
<?php if ($linea_cubierta): ?>
<div class="row mb-2">
<div class="section-title cubierta">IMP. CUBIERTA</div>
<div class="col-12">
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Tintas</th>
<th>Ejemplares</th>
<th>Maquina</th>
<th>Marcapaginas</th>
<th>Tiempo</th>
</tr>
<tr>
<td><?= $linea_cubierta->tinta() ?></td>
<td><?= $presupuesto->tirada/$presupuesto->tirada ?></td>
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600/$presupuesto->tirada) ?></td>
</tr>
<tr>
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
</tr>
</table>
<div class="comments">
<div class="flex-row cubierta"><?= lang('Produccion.comentariosCubierta') ?></div>
<div class="comment-content">
<p>
<?= $ot->comment_cubierta ?>
</p>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="row mb-2">
<div class="section-title encuadernacion">ACABADOS/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"><?= $encuadernacionCode ?></span>
</div>
<table>
<?php foreach ($acabados as $key => $acabado): ?>
<tr>
<td class="w-10 encuadernacion">Plastificado</td>
<td><?= $acabado->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;"><?= $acabado->proveedor() ? $acabado->proveedor()->nombre : "" ?></td>
</tr>
<tr>
<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 endforeach; ?>
</table>
<?php
foreach ($encuadernaciones as $key => $encuadernacion) {
$encuadernacion_code = $encuadernacion->tarifa()->code;
try {
if ($encuadernacion_code) {
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]);
} else {
echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
}
} 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">
<div class="flex-row encuadernacion"><?= lang('Produccion.comentariosEncuadernacion') ?></div>
<div class="comment-content">
<p>
<?= $ot->comment_encuadernacion ?>
</p>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div class="row mb-2">
<div class="section-title">LOGISTICA</div>
<div class="col-12">
<table>
<tr>
<th>Peso Unidad</th>
<th>Peso Pedido</th>
<th>Corte Pie</th>
</tr>
<tr>
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
<td><?= $peso_unidad > 1000 ? number_format($peso_unidad / 1000, 2, ',', '.') . " kg" : number_format($peso_unidad, 2, ',', '.') . " gr" ?> </td>
<td>-</td>
</tr>
</table>
<div class="comments">
<div class="flex-row logistica"><?= lang('Produccion.comentariosLogistica') ?></div>
<div class="comment-content">
<p>
<?= $ot->comment_logistica ?>
</p>
</div>
</div>
</div>
</div>
<div class="col-md-12 d-flex justify-content-center align-items-center">
<span class="footer">&copy; 2024 SAFEKAT. Todos los derechos reservados.</span>
</div>
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
</body>
</html>

View File

@ -1,11 +1,11 @@
$(() => {
// var opt = {
// margin: 2,
// filename: "PDF_OrdenTrabajo_" + $(".pdf-wrapper").data("id") + ".pdf",
// image: { type: 'jpeg', quality: 1 },
// html2canvas: { scale: 4 },
// jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
// };
// let elementToPdf = $('body')[0]
// html2pdf().set(opt).from(elementToPdf).save()
var opt = {
margin: 2,
filename: $(".pdf-wrapper").data("id") + ".pdf",
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 4 },
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
};
let elementToPdf = $('body')[0]
html2pdf().set(opt).from(elementToPdf).save()
})

View File

@ -153,7 +153,7 @@ class OrdenTrabajo {
this.item.on("click", "#btn-reset-tareas", this.handleResetTareasDeleteConfirmation.bind(this))
this.otForm.on("click", ".ot-tarea-comment", this.handleNoteTarea.bind(this))
$("#btn-update-tarea-comment").on("click", this.handleTareaNoteSubmit.bind(this))
this.otForm.on("change", "#ot-comment", this.handleOtComment.bind(this))
this.otForm.on("change", ".ot-comment", this.handleOtComment.bind(this))
$("#btn-update-pliegos").on('click', this.handleUpdatePliegos.bind(this))
this._handleGetData()
@ -485,17 +485,18 @@ class OrdenTrabajo {
}
handleTareaChangeError(error) { }
handleOtComment(event) {
let name = $(event.currentTarget).attr("name")
let data = {
"orden_trabajo_id": this.modelId,
"name": name,
}
data[name] = $(event.currentTarget).val()
const ajax = new Ajax(
"/produccion/ordentrabajo/update",
{
"orden_trabajo_id": this.modelId,
"name": $(event.currentTarget).attr("name"),
"comentarios": $(event.currentTarget).val()
},
data,
null,
(response) => {
this._handleGetData();
alertSuccess(response.message).fire()
},
null

View File

@ -18,7 +18,7 @@ html {
width: 210mm;
height: 297mm;
max-width: 210mm;
font-size: 11px;
font-size: 8px;
max-height: 297mm;
background-color: white;
}
@ -91,7 +91,7 @@ body {
}
.section-title {
font-weight: bold;
margin-bottom: 10px;
margin-bottom: 4px;
}
.cubierta {
color: #007bff;
@ -105,31 +105,29 @@ body {
.comments {
color: #555;
font-style: italic;
font-size : 12px;
margin-top: 0.2rem;
}
.comment-content {
line-height: 0;
width: 100%;
height: 50px;
border: solid;
border-width: 1px;
margin-left : 0.2rem;
font-style: normal;
color : black;
font-size: 10px;
}
table {
width: 100%;
margin-bottom: 5px;
margin-bottom: 2px;
font-size: 10px;
}
th, td {
border: 0.01px solid black;
}
table td {
text-align: center;
}
table,
th,
td {
border: 0.1px solid rgb(0, 0, 0);
border-collapse: collapse;
}
table th {
font-weight: bold;
@ -139,11 +137,7 @@ table th {
table td {
font-weight: bold;
}
.comments {
color: #555;
font-style: italic;
margin-top: 0.2rem;
}
.t-header {
color: black;
width: 25%;