templates/bundles/EasyAdminBundle/dashboard.html.twig line 1

Open in your IDE?
  1. {% extends '@EasyAdmin/page/content.html.twig' %}
  2. {% block page_title %}
  3. Dashboard {#({{ "now"|date("d/m/Y H:i:s") }})#}
  4. {% endblock %}
  5. {% block content_title %}<h1 class="title">{{ ea.dashboardTitle }}</h1>{% endblock %}
  6. {% block main %}
  7.   <div class="form-panel-header ">
  8.     <div class="form-panel-title">
  9.       <a href="#" class="not-collapsible">
  10.         <i class="form-panel-icon fa fa-exclamation-circle"></i>
  11.         <em>Pedidos no entregados a la sucursal</em>
  12.       </a>
  13.     </div>
  14.   </div>
  15.   <table class="table datagrid with-rounded-top" id="xmlSinEntregar">
  16.     <tbody>
  17.         {% if cabs %}
  18.           {% for cab in cabs %}
  19.               {% set url = ea_url()
  20.                 .setController('App\\Controller\\Admin\\CabeceraCrudController')
  21.                 .setAction('detail')
  22.                 .setEntityId(cab.id)
  23.               %}
  24.               <tr>
  25.                   <td><i class="fa fa-map"></i> {{ cab.sucursal }}</td>
  26.                   <td>{{ cab.nombrecliente }}</td>
  27.                   <td>{{ cab.updatedAt|date("d/m/Y H:i:s") }}</td>
  28.                   <td>{{ cab.filename }}</td>
  29.                   <td><a href="{{ url }}">ver</a>
  30.               </tr>
  31.           {% endfor %}
  32.         {% else %}
  33.           {# <tr class="empty-row">
  34.             <td><span></span></td>
  35.             <td><span></span></td>
  36.             <td><span></span></td>
  37.             <td><span></span></td>
  38.             <td><span></span></td>
  39.           </tr>
  40.           <tr class="empty-row">
  41.             <td><span></span></td>
  42.             <td><span></span></td>
  43.             <td><span></span></td>
  44.             <td><span></span></td>
  45.             <td><span></span></td>
  46.           </tr>
  47.           <tr class="no-results">
  48.           <td colspan="100">
  49.           No se han encontrado resultados.
  50.           </td>
  51.           </tr>
  52.           <tr class="empty-row">
  53.             <td><span></span></td>
  54.             <td><span></span></td>
  55.             <td><span></span></td>
  56.             <td><span></span></td>
  57.             <td><span></span></td>
  58.           </tr>
  59.           <tr class="empty-row">
  60.             <td><span></span></td>
  61.             <td><span></span></td>
  62.             <td><span></span></td>
  63.             <td><span></span></td>
  64.             <td><span></span></td>
  65.           </tr> #}
  66.         {% endif %}
  67.     </tbody>
  68.   </table>
  69.   {# indicadores  #}
  70.   <div class="form-panel-header ">
  71.     <div class="form-panel-title">
  72.       <a href="#" class="not-collapsible">
  73.         <i class="form-panel-icon fa fa-truck"></i>
  74.         <em>Estado de las sucursales (según capacidad)</em>
  75.       </a>
  76.     </div>
  77.   </div>
  78.   <table class="datagrid">
  79.     <thead>
  80.         <tr>
  81.             <th><span><strong>Sucursal</strong></span></th>
  82.             <th><span><strong># en preparación (Callcenter)</strong></span></th>
  83.             <th><span><strong># en preparación (Ecommerce)</strong></span></th>
  84.             <th><span><strong># pedidos en reparto</strong></span></th>
  85.             <th><span><strong># TOTAL PEDIDOS</strong></span></th>
  86.             <th><span><strong># max de pedidos en reparto</strong></span></th>
  87.         </tr>
  88.     </thead>
  89.     <tbody>
  90.       {% for nombreSucursal, datosSucursal in resultadosConsolidados %}
  91.         <tr>
  92.           <td clasS="text-left">{{ nombreSucursal }}</td>
  93.           <td class="text-center">
  94.             {% if datosSucursal.detalles.callcenter is defined %}
  95.                 {% for detalle in datosSucursal.detalles.callcenter %}
  96.                     {{ detalle.preparacion }}
  97.                 {% endfor %}
  98.             {% else %}
  99.                 Sin datos
  100.             {% endif %}
  101.           </td>
  102.           <td class="text-center">
  103.             {% if datosSucursal.detalles.ecommerce is defined %}
  104.                 {% for detalle in datosSucursal.detalles.ecommerce %}
  105.                     {{ detalle.preparacion }}
  106.                 {% endfor %}
  107.             {% else %}
  108.                 Sin datos
  109.             {% endif %}
  110.           </td>
  111.           <td clasS="text-center">
  112.             {% set porcentaje = (70 * datosSucursal.sucursal.getOrderCapacity)/100 %}
  113.             {% if datosSucursal.total.reparto < porcentaje|round %}
  114.               {% set class = 'badge-success' %}
  115.             {% elseif datosSucursal.total.reparto >= porcentaje|round and datosSucursal.total.reparto < datosSucursal.sucursal.getOrderCapacity %}
  116.               {% set class = 'badge-warning' %}
  117.             {% else %}
  118.               {% set class = 'badge-danger' %}
  119.             {% endif %}
  120.             <span class="badge badge-pill {{ class }}"><strong>{{ datosSucursal.total.reparto }}</strong></span>
  121.           </td>
  122.           <td clasS="text-center">{{ datosSucursal.total.preparacion + datosSucursal.total.reparto }}</td>
  123.           <td clasS="text-center">{{ datosSucursal.sucursal.getOrderCapacity }}</td>
  124.           {# <td clasS="text-left">{{ indicator.preparacion }}</td> #}
  125.           {# <td clasS="text-left">
  126.             {% set porcentaje = (70 * indicator.sucursal.getOrderCapacity)/100 %}
  127.             {% if indicator.reparto < porcentaje|round %}
  128.               {% set class = 'badge-success' %}
  129.             {% elseif indicator.reparto >= porcentaje|round and indicator.reparto < indicator.sucursal.getOrderCapacity %}
  130.               {% set class = 'badge-warning' %}
  131.             {% else %}
  132.               {% set class = 'badge-danger' %}
  133.             {% endif %}
  134.             <span class="badge badge-pill {{ class }}"><strong>{{ indicator.reparto }}</strong></span>
  135.           </td> #}
  136.           {# <td clasS="text-left">{{ indicator.preparacion + indicator.reparto }}</td>
  137.           <td clasS="text-left">{{ indicator.sucursal.getOrderCapacity }}</td> #}
  138.         </tr>
  139.       {% endfor %}
  140.     </tbody>
  141.     <tfoot></tfoot>
  142.   </table>
  143.   {# <section class="content-header">
  144.     <div class="content-header-title">
  145.       <h1 class="title">Pedidos no entregados a la sucursal</h1>
  146.     </div>
  147.   </section> #}
  148.   {% block body_custom_javascript %}
  149.  <script>
  150.     var notification = new Audio('{{ asset('sounds/Notification.mp3') }}');
  151.     function xmlSinEntregar() {
  152.       var tbl = document.getElementById("xmlSinEntregar");
  153.       if (tbl.rows.length == 0) {
  154.         // console.log('No hay pedidos');
  155.       } else {
  156.         // console.log('La tabla tiene ' + tbl.rows.length + ' Pedido(s) sin entregar');
  157.         notification.play();
  158.       }
  159.       alertaXmlSinEntregar();
  160.     }
  161.     function alertaXmlSinEntregar(){
  162.       let tiempo = '{{actualizardashboard}}' * 1000;
  163.       setTimeout(function(){
  164.         location.reload()
  165.       }, tiempo);
  166.     }
  167.     xmlSinEntregar();
  168.   </script>
  169.   {% endblock %}
  170. {% endblock %}