templates/higotrigo/ht_file/summary-htfile-pdf.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="es">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>Orden de Trabajo</title>
  7.     <style>
  8.         /* Reset de box-sizing */
  9.         *, *::before, *::after {
  10.             box-sizing: border-box;
  11.         }
  12.         body {
  13.             font-family: Arial, sans-serif;
  14.             font-size: 12px;
  15.             color: #333;
  16.             margin: 0;
  17.             padding: 0;
  18.         }
  19.         /* Contenedor */
  20.         .container {
  21.             width: 100%;
  22.             padding: 10px;
  23.             margin: 0 auto;
  24.         }
  25.         /* Clearfix para limpiar flotados */
  26.         .clearfix::after {
  27.             content: "";
  28.             display: table;
  29.             clear: both;
  30.         }
  31.         /* Columnas basadas en flotantes */
  32.         [class*="col-xs-"] {
  33.             float: left;
  34.             padding: 5px;
  35.         }
  36.         .col-xs-12 {
  37.             width: 100%;
  38.         }
  39.         .col-xs-6 {
  40.             width: 50%;
  41.         }
  42.         .col-xs-5 {
  43.             width: 41.666667%;
  44.         }
  45.         .col-xs-4 {
  46.             width: 33.333333%;
  47.         }
  48.         .col-xs-3 {
  49.             width: 25%;
  50.         }
  51.         .col-xs-2 {
  52.             width: 16.666667%;
  53.         }
  54.         .col-xs-1 {
  55.             width: 8.333333%;
  56.         }
  57.         /* Paneles */
  58.         .panel {
  59.             border: 1px solid #ccc;
  60.             border-radius: 3px;
  61.             margin-bottom: 10px;
  62.             background-color: #fff;
  63.         }
  64.         .panel-heading {
  65.             padding: 5px 10px;
  66.             border-bottom: 1px solid #ccc;
  67.             background-color: #e9ecef;
  68.             font-weight: bold;
  69.             font-size: 16px;
  70.             position: relative;
  71.         }
  72.         .panel-title {
  73.             margin: 0;
  74.             font-size: 14px;
  75.         }
  76.         /* Tablas */
  77.         table {
  78.             width: 100%;
  79.             border-collapse: collapse;
  80.             margin-bottom: 10px;
  81.         }
  82.         table th, table td {
  83.             border: 1px solid #ddd;
  84.             padding: 5px;
  85.             text-align: left;
  86.             vertical-align: top;
  87.             font-size: 12px;
  88.         }
  89.         table th {
  90.             background-color: #f2f2f2;
  91.             font-weight: bold;
  92.             font-size: 13px;
  93.         }
  94.         /* Utilidades de espaciado */
  95.         .mb-5 {
  96.             margin-bottom: 5px;
  97.         }
  98.         .mt-5 {
  99.             margin-top: 5px;
  100.         }
  101.         /* Tipografías */
  102.         h3, h4, h5, h6 {
  103.             margin: 5px 0;
  104.             font-weight: bold;
  105.         }
  106.         h3 {
  107.             font-size: 16px;
  108.         }
  109.         h4 {
  110.             font-size: 14px;
  111.         }
  112.         h5 {
  113.             font-size: 13px;
  114.         }
  115.         h6 {
  116.             font-size: 12px;
  117.         }
  118.         /* Evitar saltos de página dentro de un servicio */
  119.         .service {
  120.             page-break-inside: avoid;
  121.             break-inside: avoid;
  122.             margin-bottom: 10px;
  123.         }
  124.         /* Espaciado entre servicios */
  125.         .service + .service {
  126.             margin-top: 10px;
  127.         }
  128.         /* Observaciones */
  129.         .observations {
  130.             background-color: #fff;
  131.             font-size: 12px;
  132.         }
  133.         /* Leyendas */
  134.         legend {
  135.             font-size: 13px;
  136.             margin-bottom: 5px;
  137.             font-weight: bold;
  138.         }
  139.         /* Ajustes para el contenido dentro de paneles */
  140.         .panel .panel-body .row {
  141.             margin-left: -5px;
  142.             margin-right: -5px;
  143.         }
  144.         .panel .panel-body .col-xs-12 {
  145.             padding-left: 5px;
  146.             padding-right: 5px;
  147.         }
  148.         /* Limpiar flotados en filas */
  149.         .row {
  150.             margin-left: -5px;
  151.             margin-right: -5px;
  152.         }
  153.         /* Texto truncado */
  154.         .text-truncate {
  155.             white-space: nowrap;
  156.             overflow: hidden;
  157.             text-overflow: ellipsis;
  158.         }
  159.         /* Texto en mayúsculas */
  160.         .text-uppercase {
  161.             text-transform: uppercase;
  162.         }
  163.         /* Tabla de Escandallos en dos columnas */
  164.         .escandallos-table {
  165.             width: 100%;
  166.         }
  167.         .escandallos-table td {
  168.             width: 50%;
  169.         }
  170.         /* Tabla de Observaciones en dos columnas */
  171.         .observations-table {
  172.             width: 100%;
  173.         }
  174.         .observations-table td {
  175.             width: 50%;
  176.         }
  177.     </style>
  178. </head>
  179. <body>
  180.     <div class="container">
  181.         <div class="row clearfix">
  182.             <div class="col-xs-12">
  183.                 {% if ht_file is not empty %}
  184.                 <!-- Resumen -->
  185.                 <div class="panel">
  186.                     <div class="panel-heading">
  187.                         RESUMEN
  188.                     </div>
  189.                     {% if ht_file.clientType is not empty %}
  190.                     <div class="panel-heading">
  191.                         Tipo de comensal: {{ ht_file.clientType }}
  192.                     </div>
  193.                     {% endif %}
  194.                     <div class="panel-body">
  195.                         <table>
  196.                             <thead>
  197.                                 <tr>
  198.                                     <th>SERVICIO</th>
  199.                                     <th>HORARIO</th>
  200.                                     <th>PAX</th>
  201.                                     <th>ESPACIO/SALA</th>
  202.                                 </tr>
  203.                             </thead>
  204.                             <tbody>
  205.                                 {% set i = 1 %}
  206.                                 {% for elem in arrayElem %}
  207.                                 <tr class="service">
  208.                                     <td>{{ i }}: {{ elem.htItem.dateStart|date('l')|trans }} {{ elem.htItem.dateStart|date('j') }}, 
  209.                                     {% if elem.htItem.htMenus is not null %}
  210.                                         {% for menu in elem.htItem.htMenus %}
  211.                                             {{ menu.name }}{% if not loop.last %}, {% endif %}
  212.                                         {% endfor %}
  213.                                     {% endif %} 
  214.                                     </td>
  215.                                     <td>{{ elem.htItem.dateStart|date('H:i') }} a {{ elem.htItem.hourEnd|date('H:i') }}</td>
  216.                                     <td>{{ elem.htItem.pax }}</td>
  217.                                     <td>{% if elem.htItem.loungeGp is not null %} {{ elem.htItem.loungeGp.name }} {% else %} {{ elem.htItem.loungeOther }} {% endif %}</td>
  218.                                 </tr>
  219.                                 {% set i = i + 1 %}
  220.                                 {% endfor %}
  221.                             </tbody>
  222.                         </table>
  223.                         <!-- Observaciones -->
  224.                         <div class="row clearfix">
  225.                             <div class="col-xs-12">
  226.                                 <h5>Observaciones</h5>
  227.                             </div>
  228.                         </div>
  229.                         <div class="observations">
  230.                             <table class="observations-table">
  231.                                 <tbody>
  232.                                     {# Recopilar todas las observaciones en una lista #}
  233.                                     {% set observations = [] %}
  234.                                     {% set i = 1 %}
  235.                                     {% for elem in arrayElem %}
  236.                                         {% if elem.htItem.observation is not empty %}
  237.                                             {% set observations = observations|merge([{'service': i, 'obs': elem.htItem.observation|raw}]) %}
  238.                                             {% set i = i + 1 %}
  239.                                         {% endif %}
  240.                                     {% endfor %}
  241.                                     {# Agrupar observaciones en pares manualmente #}
  242.                                     {% for elem in observations %}
  243.                                         {% if loop.index0 is divisible by(2) %}
  244.                                             <tr>
  245.                                         {% endif %}
  246.                                         <td>
  247.                                             <strong>Servicio {{ elem.service }}:</strong> {{ elem.obs|raw }}
  248.                                         </td>
  249.                                         {% if loop.index is divisible by(2) %}
  250.                                             </tr>
  251.                                         {% endif %}
  252.                                     {% endfor %}
  253.                                     {# Si el número de observaciones es impar, cerrar la última fila #}
  254.                                     {% if observations|length is odd %}
  255.                                         <td></td>
  256.                                         </tr>
  257.                                     {% endif %}
  258.                                 </tbody>
  259.                             </table>
  260.                         </div>
  261.                     </div>
  262.                 </div>
  263.                 <!-- Detalles de Servicios -->
  264.                 {% set dias_semana = ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'] %}
  265.                 {% set meses = ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto',
  266.                 'septiembre', 'octubre', 'noviembre', 'diciembre'] %}
  267.                 {% set dia_semana = ht_file.updatedAt.format('w') %}
  268.                 {% set dia = ht_file.updatedAt.format('j') %}
  269.                 {% set mes = ht_file.updatedAt.format('n') %}
  270.                 {% set year = ht_file.updatedAt.format('Y') %}
  271.                 {% set i = 1 %}
  272.                 {% for elem in arrayElem %}
  273.                 <div class="panel service">
  274.                     <div class="panel-heading">
  275.                         SERV {{ i }} ({{ elem.htItem.dateStart|date('d/m/Y') }})
  276.                         <span style="float: right; font-size: 10px; color: #777;">
  277.                             {{ ht_file.title }} - Última actualización: {{ dias_semana[dia_semana] }} {{ dia }}, de {{ meses[mes - 1] }} de {{ year }}
  278.                         </span>
  279.                     </div>
  280.                     <div class="panel-body">
  281.                         <table>
  282.                             <tr>
  283.                                 <td><strong>Sala:</strong> {{ elem.lounge }}</td>
  284.                                 <td><h4>Inicio:{{ elem.htItem.dateStart|date('H:i') }}</h4></td>
  285.                                 <td><h4>Fin:{{ elem.htItem.hourEnd|date('H:i') }}</h4></td>
  286.                                 <td><strong>Pax:</strong> {{ elem.htItem.pax }}</td>
  287.                             </tr>
  288.                         </table>
  289.                         {% if elem.htMenus is not null %}
  290.                         {% for menu in elem.htMenus %}
  291.                             <legend class="text-uppercase">Menú: {{ menu.htMenu.name }}</legend>
  292.                             <table class="escandallos-table">
  293.                                 <tbody>
  294.                                     {% for escan in menu.arrayEscandallos %}
  295.                                         {% if loop.index0 is even %}
  296.                                             <tr>
  297.                                         {% endif %}
  298.                                         <td>{{ escan.escandallo.nombre }}</td>
  299.                                         {% if loop.index0 is odd or loop.last %}
  300.                                             </tr>
  301.                                         {% endif %}
  302.                                     {% endfor %}
  303.                                 </tbody>
  304.                             </table>
  305.                         {% endfor %}
  306.                         {% endif %}
  307.                     </div>
  308.                 </div>
  309.                 {% set i = i + 1 %}
  310.                 {% endfor %} 
  311.                 {% endif %}
  312.                 {% if reserva is not null %}
  313.                 <!-- Información General del Evento -->
  314.                 <div class="panel">
  315.                     <div class="panel-heading">
  316.                         Información General del Evento
  317.                     </div>
  318.                     <div class="panel-body">
  319.                         <table>
  320.                             <tr>
  321.                                 <td><strong>Inicio:</strong> {{ reserva.dateStart|date('l')|trans }} {{ reserva.dateStart|date('d/m/Y') }}, a las {{ reserva.dateStart|date('H:i') }}</td>
  322.                                 <td><strong>Fin:</strong> {{ reserva.dateEnd|date('l')|trans }} {{ reserva.dateEnd|date('d/m/Y') }}, a las {{ reserva.dateEnd|date('H:i') }}</td>
  323.                             </tr>
  324.                             {% if montaje is not null %}
  325.                             <tr>
  326.                                 <td colspan="2"><strong>Montaje:</strong> {{ montaje.dateStart|date('l')|trans }} {{ montaje.dateStart|date('j') }}, desde las {{ montaje.dateStart|date('H:i') }} hasta {{ montaje.dateEnd|date('H:i') }}</td>
  327.                             </tr>
  328.                             {% endif %}
  329.                             {% if desmontaje is not null %}
  330.                             <tr>
  331.                                 <td colspan="2"><strong>Desmontaje:</strong> {{ desmontaje.dateStart|date('l')|trans }} {{ desmontaje.dateStart|date('j') }}, desde las {{ desmontaje.dateStart|date('H:i') }} hasta {{ desmontaje.dateEnd|date('H:i') }}</td>
  332.                             </tr>
  333.                             {% endif %}
  334.                         </table>
  335.                     </div>
  336.                 </div>
  337.                 {% endif %}
  338.             </div>
  339.         </div>
  340.     </div>
  341. </body>
  342. </html>