templates/movimientos/orden_reparacion_externa/index.html.twig line 1

Open in your IDE?
  1. {% extends 'navbar.html.twig' %}
  2. {% block title %}Orden Reparacion Externa{% endblock %}
  3. {% block content_user %}
  4.     <h5>Orden Reparacion Externa</h5>
  5.     <hr>
  6.     <table id="example" class="table table-striped table-bordered table-hover">
  7.         <thead>
  8.             <tr>
  9.                 <th>Numero</th>
  10.                 <th>Fecha</th>
  11.                 <th>Proveedor</th>
  12.                 <th>Procesada</th>
  13.                 <th>Observaciones</th>
  14.                 <th></th>
  15.             </tr>
  16.         </thead>
  17.         <tbody>
  18.         {% for orden_reparacion_externa in orden_reparacion_externas %}
  19.             <tr>
  20.                 <td>{{ "%06d"|format(orden_reparacion_externa.numero) }}</td>
  21.                 <td>{{ orden_reparacion_externa.fecha ? orden_reparacion_externa.fecha|date('d/m/Y') : '' }}</td>
  22.                 <td>{{ orden_reparacion_externa.proveedorExterno }}</td>
  23.                 <td>{{ orden_reparacion_externa.yaProcesada ? 'Si' : 'No' }}</td>
  24.                 <td>{{ orden_reparacion_externa.observaciones }}</td>
  25.                 <td>
  26.                     <a href="{{ path('app_movimientos_item_movimiento_new', {'id': orden_reparacion_externa.id}) }}" class="btn btn-success btn-sm">
  27.                             {{ orden_reparacion_externa.yaProcesada ? 'Ver' : 'Editar' }}
  28.                     </a>
  29.                     {% if not orden_reparacion_externa.finalizoCircuito %}
  30.                         {% if orden_reparacion_externa.yaProcesada  %}
  31.                             <a href="{{ path('app_movimientos_item_movimiento_ingresar', {'id': orden_reparacion_externa.id}) }}" 
  32.                                class="btn btn-danger btn-sm">Devolucion</a>
  33.                         {% endif %}
  34.                     {% endif %}
  35.                 </td>
  36.             </tr>
  37.         {% endfor %}
  38.         </tbody>
  39.     </table>
  40.     <a href="{{ path('app_movimientos_orden_reparacion_externa_new') }}" class="btn btn-primary">Nueva Orden Reparacion Externa</a>
  41. {% endblock %}
  42. {% block javascripts_footer %}
  43.     
  44.     {{ parent() }}
  45.     <script type="text/javascript">
  46.         $('.btn-confirm').click(function(event){
  47.                                                 event.preventDefault();
  48.                                                 let a = $(this);
  49.                                                 bootbox.confirm({
  50.                                                                     message: 'Seguro confirmar el prestamo # ' + a.data('loop') + '?',
  51.                                                                     buttons: {
  52.                                                                             confirm: {
  53.                                                                                     label: 'Si, confirmar',
  54.                                                                                     className: 'btn-success'
  55.                                                                             },
  56.                                                                             cancel: {
  57.                                                                                     label: 'No, cancelar',
  58.                                                                                     className: 'btn-danger'
  59.                                                                             }
  60.                                                                     },
  61.                                                                     callback: function (result) {
  62.                                                                                                   if (result)
  63.                                                                                                   {
  64.                                                                                                         $.post(a.attr('href'),
  65.                                                                                                                function (data){
  66.                                                                                                                                 if (data.ok)
  67.                                                                                                                                 {
  68.                                                                                                                                     window.location.href = window.location.href;
  69.                                                                                                                                 }
  70.                                                                                                                                 else
  71.                                                                                                                                 {
  72.                                                                                                                                     bootbox.alert(data.msg);
  73.                                                                                                                                 }
  74.                                                                                                                });
  75.                                                                                                   }
  76.                                                                                                 }
  77.                                                                 });
  78.         });
  79.         $('#example').DataTable({
  80.                                     fixedHeader: true,
  81.                                     paging: true,
  82.                                     responsive: true,
  83.                                     order: [[ 0, 'desc' ]],
  84.                                     language: {
  85.                                         url: '{{ asset('i18n/spanish.json') }}'
  86.                                     }
  87.                                 });
  88.     </script>
  89. {% endblock %}