templates/callcenter/_cliente.html.twig line 1

Open in your IDE?
  1. {# <div class="border border-secundary rounded bg-white p-3"> #}
  2. <div class="border border-secundary bg-white p-3">
  3.     {{ form_start(form) }}
  4.     {{ form_row(form._token) }}
  5.     {{ form_errors(form) }}
  6.     <div class="row g-3">
  7.         <div class="col-sm-6">
  8.             {# {% if form.facturaelectronica is defined %}
  9.                 <div class="form-check">
  10.                     {{ form_widget(form.facturaelectronica, {'attr': {'class': 'form-check-input'}}) }}
  11.                     <label class="form-check-label" for="flexCheckDefault">
  12.                         Factura Electrónica
  13.                     </label>
  14.                 </div>
  15.             {% endif %} #}
  16.         </div>
  17.         <div class="col-sm-6">
  18.             <div class="input-group flex-row-reverse">
  19.                 <div class="btn-group btn-group-sm" role="group" aria-label="Basic radio toggle button group">
  20.                     {{ form_widget(form.tipodeservicio[0], {'attr': {'class': 'btn-check',
  21.                                                             'data-action':'hello#tipodeservicio',
  22.                                                             'data-bs-toggle':'collapse',
  23.                                                             'data-bs-target':'.multi-collapse.show'
  24.                                                             }}) }}
  25.                     {{ form_label(form.tipodeservicio[0], null, {'label_attr': {'class': 'btn btn-outline-primary'}}) }}
  26.                     {{ form_widget(form.tipodeservicio[1], {'attr': {'class': 'btn-check',
  27.                                                             'data-action':'hello#tipodeservicio',
  28.                                                             'data-bs-toggle':'collapse',
  29.                                                             'data-bs-target':'.multi-collapse:not(.show)'
  30.                                                             }}) }}
  31.                     {{ form_label(form.tipodeservicio[1], null, {'label_attr': {'class': 'btn btn-outline-primary'}}) }}
  32.                     {{ form_widget(form.tipodeservicio[2], {'attr': {'class': 'btn-check',
  33.                                                             'data-action':'hello#tipodeservicio',
  34.                                                             'data-bs-toggle':'collapse',
  35.                                                             'data-bs-target':'.multi-collapse:not(.show)'
  36.                                                             }}) }}
  37.                     {{ form_label(form.tipodeservicio[2], null, {'label_attr': {'class': 'btn btn-outline-primary'}}) }}
  38.                 </div>
  39.             </div>
  40.         </div>
  41.         <div class="col-sm-4">
  42.             {{ form_widget(form.nombres, {'attr': {'class': 'form-control form-control-sm', 'placeholder': 'Nombres'}}) }}
  43.         </div>
  44.         <div class="col-sm-4">
  45.             {{ form_widget(form.apellidos, {'attr': {'class': 'form-control form-control-sm', 'placeholder': 'Apellidos'}}) }}
  46.         </div>
  47.         <div class="col-sm-4">
  48.             {# {{ form_widget(form.telefonocliente, {'attr': {'class': 'form-control form-control-sm', 'placeholder': 'Telefono'}}) }} #}
  49.             {# Añadir la clase 'is-invalid' si hay errores #}
  50.             {{ form_widget(form.telefonocliente, {'attr': {'class': 'form-control form-control-sm' ~ (form.telefonocliente.vars.errors|length > 0 ? ' is-invalid' : ''), 'placeholder': 'Telefono'}}) }}
  51.             {% if form.telefonocliente.vars.errors|length > 0 %}
  52.                 <div class="invalid-feedback d-block">
  53.                     {% for error in form.telefonocliente.vars.errors %}
  54.                         <p>{{ error.message }}</p>
  55.                     {% endfor %}
  56.                 </div>
  57.             {% endif %}
  58.         </div>
  59.         <div class="col-sm-8">
  60.             {{ form_widget(form.emailcliente, {'attr': {'class': 'form-control form-control-sm', 'placeholder': 'Email'}}) }}
  61.         </div>
  62.         <div class="col-sm-4">
  63.             {{ form_widget(form.nifcliente, {'attr': {'class': 'form-control form-control-sm' ~ (form.nifcliente.vars.errors|length > 0 ? ' is-invalid' : ''), 'placeholder': 'Cédula'}}) }}
  64.             {% if form.nifcliente.vars.errors|length > 0 %}
  65.                 <div class="invalid-feedback d-block">
  66.                     {% for error in form.nifcliente.vars.errors %}
  67.                         <p>{{ error.message }}</p>
  68.                     {% endfor %}
  69.                 </div>
  70.             {% endif %}
  71.         </div>
  72.         <div class="col-sm-12 multi-collapse collapse" id="fechareserva">
  73.             <div class="row">
  74.                 <div class="col-sm-5">Fecha y Hora</div>
  75.                 <div class="col-sm-3">
  76.                     <div class="input-group">
  77.                         {{ form_widget(form.fechareserva.date, {'attr': {'class': 'form-control form-control-sm',
  78.                                             'data-hello-target': 'reservafecha' }, 'disabled': 'disabled'}) }}
  79.                     </div>
  80.                 </div>
  81.                 <div
  82.                     class="col-sm-4">
  83.                     {#{ form_label(form.fechareserva.time, 'Hora', {'label_attr': {'class': 'form-label'}}) }#}
  84.                     {% set foo = "" %}
  85.                     {% if not form.vars.valid %}
  86.                         {% set foo = ' is-invalid'%}
  87.                     {% endif %}
  88.                     <div class="input-group">
  89.                         {{ form_widget(form.fechareserva.time.hour, {'attr': {'class': 'form-select form-select-sm',
  90.                                             'data-hello-target': 'reservahora' }, 'disabled': 'disabled'}) }}
  91.                         {{ form_widget(form.fechareserva.time.minute, {'attr': {'class': 'form-select form-select-sm',
  92.                                             'data-hello-target': 'reservaminuto' }, 'disabled': 'disabled'}) }}
  93.                     </div>
  94.                 </div>
  95.                 {# {{ form_errors(form.fechareserva) }} #}
  96.                 <div class="invalid-feedbacks">
  97.                     <small class="text-danger">
  98.                         <strong>{{ form_errors(form.fechareserva) }}</strong>
  99.                     </small>
  100.                 </div>
  101.             </div>
  102.         </div>
  103.         <div class="col-12">
  104.             {{ form_label(form.direccioncliente, 'Dirección', {'label_attr': {'class': 'form-label'}}) }}
  105.             <div class="input-group">
  106.                 {{ form_widget(form.direccioncliente, {'attr': {'class': 'form-control form-control-sm',
  107.                                                                 'data-hello-target': 'addr',
  108.                                                                                                                                 'data-action': 'input->hello#limitInput',
  109.                                                                                                                                 'data-input-target': 'observaciones',
  110.                                                                                                                                 'data-max-length': '50'
  111.                 }}) }}
  112.                 <button class="btn btn-secondary btn-sm" type="button" id="button-addon">Localizar</button>
  113.             </div>
  114.         </div>
  115.         <div class="col-12">
  116.             {{ form_label(form.direccion2cliente, 'Observaciones', {'label_attr': {'class': 'form-label'}}) }}
  117.             {{ form_widget(form.direccion2cliente, {'attr': {'class': 'form-control',
  118.                                                                                                                                 'data-hello-target': 'complemento',
  119.                                                                                                                                 'placeholder': 'Conjunto, torre, Apartamento...' ,
  120.                                                                                                                                 'data-action': 'input->hello#limitInput',
  121.                                                                                                                                 'data-input-target': 'observaciones',
  122.                                                                                                                                 'data-max-length': '55'
  123.             }}) }}
  124.         </div>
  125.         {% if cliente is not empty %}
  126.             {% if cliente.es_cliente_bitcubo is defined %}
  127.                 <div class="col-sm-12">
  128.                     <p>Otras direcciones</p>
  129.                     <div class="list-group" id="address">
  130.                     {% for direccion in cliente.direcciones_bitcubo %}
  131.                         {% if direccion.direccion|length > 7 %}
  132.                             <button
  133.                                 type="button"
  134.                                 class="list-group-item list-group-item-action btn-sm list-group-item-dark"
  135.                                 data-action="hello#select"
  136.                                 data-direccion="{{ direccion.direccion|e('html_attr') }}"
  137.                             data-complemento="{{ direccion.complemento|e('html_attr') }}"
  138.                             >
  139.                                 {{ direccion.direccion }} <span><small>{{ direccion.complemento }}</small></span>
  140.                             </button>
  141.                         {% endif %}
  142.                     {% endfor %}
  143.                     </div>
  144.                 </div>
  145.             {% else %}
  146.                 {% if cliente is defined and 'direcciones' in cliente %}
  147.                     <div class="col-sm-12">
  148.                         <p>Otras direcciones</p>
  149.                         <div class="list-group" id="address">
  150.                                 {# {% if cliente|length > 7 %}
  151.                                     <button type="button" class="list-group-item list-group-item-action btn-sm list-group-item-secondary active" data-action="hello#select">
  152.                                         {{ cliente }}
  153.                                     </button>
  154.                                 {% endif %} #}
  155.                             {% for direccion in cliente.direcciones %}
  156.                                 {% if direccion.direccion1|length > 7 %}
  157.                                     <button
  158.                                         type="button"
  159.                                         class="list-group-item list-group-item-action btn-sm list-group-item-dark"
  160.                                         data-action="hello#select"
  161.                                         data-direccion="{{ direccion.direccion1|e('html_attr') }}"
  162.                                     data-complemento="{{ direccion.direccion2|e('html_attr') }}"
  163.                                     >
  164.                                             {{ direccion.direccion1 }} <span><small>{{ direccion.direccion2 }}</small></span>
  165.                                     </button>
  166.                                 {% endif %}
  167.                                 {# {% if item.direcciondelaotratabla is defined %}
  168.                                     {% if item.direcciondelaotratabla|length > 7 %}
  169.                                         <button type="button" class="list-group-item list-group-item-action btn-sm list-group-item-dark" data-action="hello#select">{{ item.direcciondelaotratabla }}</button>
  170.                                     {% endif %}
  171.                                 {% endif %} #}
  172.                             {% endfor %}
  173.                         </div>
  174.                     </div>
  175.                 {% endif %}
  176.             {% endif %}
  177.         {% endif %}
  178.         <hr/>
  179.         <h5>Datos de envío</h5>
  180.         <div class="col-sm-6">
  181.             {{ form_widget(form.nombre_receptor, {'attr': {'class': 'form-control form-control-sm',
  182.                                                             'placeholder': 'Nombre del que recibe',
  183.                                                             'data-action': 'input->hello#limitInput',
  184.                                                             'data-input-target': 'nombrereceptor',
  185.                                                             'data-max-length': '26'
  186.                                                         }}) }}
  187.         </div>
  188.         <div class="col-sm-6">
  189.             {{ form_widget(form.telefono_receptor, {'attr': {'class': 'form-control form-control-sm',
  190.                                                             'placeholder': 'Telefono del que recibe',
  191.                                                             'data-action': 'input->hello#limitInput',
  192.                                                             'data-input-target': 'telefonoreceptor',
  193.                                                             'data-max-length': '10'
  194.                                                         }}) }}
  195.         </div>
  196.         {# <div class="col-12">
  197.             {{ form_widget(form.observaciones_receptor, {'attr': {'class': 'form-control form-control-sm',
  198.                                                                 'placeholder': 'Observaciones',
  199.                                                                 'data-action': 'input->hello#limitInput',
  200.                                                                 'data-input-target': 'observacionesreceptor',
  201.                                                                 'data-max-length': '135'
  202.                                                         }}) }}
  203.         </div> #}
  204.     </div>
  205.     <hr/>
  206.     {{ form_widget(form.sucursal) }}
  207.     {{ form_widget(form.save, {'attr': {'class': 'w-100 btn btn-primary btn-lg disabled'}}) }}
  208.     {{ form_end(form) }}
  209. </div>