{# <div class="border border-secundary rounded bg-white p-3"> #}
<div class="border border-secundary bg-white p-3">
{{ form_start(form) }}
{{ form_row(form._token) }}
{{ form_errors(form) }}
<div class="row g-3">
<div class="col-sm-6">
{# {% if form.facturaelectronica is defined %}
<div class="form-check">
{{ form_widget(form.facturaelectronica, {'attr': {'class': 'form-check-input'}}) }}
<label class="form-check-label" for="flexCheckDefault">
Factura Electrónica
</label>
</div>
{% endif %} #}
</div>
<div class="col-sm-6">
<div class="input-group flex-row-reverse">
<div class="btn-group btn-group-sm" role="group" aria-label="Basic radio toggle button group">
{{ form_widget(form.tipodeservicio[0], {'attr': {'class': 'btn-check',
'data-action':'hello#tipodeservicio',
'data-bs-toggle':'collapse',
'data-bs-target':'.multi-collapse.show'
}}) }}
{{ form_label(form.tipodeservicio[0], null, {'label_attr': {'class': 'btn btn-outline-primary'}}) }}
{{ form_widget(form.tipodeservicio[1], {'attr': {'class': 'btn-check',
'data-action':'hello#tipodeservicio',
'data-bs-toggle':'collapse',
'data-bs-target':'.multi-collapse:not(.show)'
}}) }}
{{ form_label(form.tipodeservicio[1], null, {'label_attr': {'class': 'btn btn-outline-primary'}}) }}
{{ form_widget(form.tipodeservicio[2], {'attr': {'class': 'btn-check',
'data-action':'hello#tipodeservicio',
'data-bs-toggle':'collapse',
'data-bs-target':'.multi-collapse:not(.show)'
}}) }}
{{ form_label(form.tipodeservicio[2], null, {'label_attr': {'class': 'btn btn-outline-primary'}}) }}
</div>
</div>
</div>
<div class="col-sm-4">
{{ form_widget(form.nombres, {'attr': {'class': 'form-control form-control-sm', 'placeholder': 'Nombres'}}) }}
</div>
<div class="col-sm-4">
{{ form_widget(form.apellidos, {'attr': {'class': 'form-control form-control-sm', 'placeholder': 'Apellidos'}}) }}
</div>
<div class="col-sm-4">
{# {{ form_widget(form.telefonocliente, {'attr': {'class': 'form-control form-control-sm', 'placeholder': 'Telefono'}}) }} #}
{# Añadir la clase 'is-invalid' si hay errores #}
{{ form_widget(form.telefonocliente, {'attr': {'class': 'form-control form-control-sm' ~ (form.telefonocliente.vars.errors|length > 0 ? ' is-invalid' : ''), 'placeholder': 'Telefono'}}) }}
{% if form.telefonocliente.vars.errors|length > 0 %}
<div class="invalid-feedback d-block">
{% for error in form.telefonocliente.vars.errors %}
<p>{{ error.message }}</p>
{% endfor %}
</div>
{% endif %}
</div>
<div class="col-sm-8">
{{ form_widget(form.emailcliente, {'attr': {'class': 'form-control form-control-sm', 'placeholder': 'Email'}}) }}
</div>
<div class="col-sm-4">
{{ form_widget(form.nifcliente, {'attr': {'class': 'form-control form-control-sm' ~ (form.nifcliente.vars.errors|length > 0 ? ' is-invalid' : ''), 'placeholder': 'Cédula'}}) }}
{% if form.nifcliente.vars.errors|length > 0 %}
<div class="invalid-feedback d-block">
{% for error in form.nifcliente.vars.errors %}
<p>{{ error.message }}</p>
{% endfor %}
</div>
{% endif %}
</div>
<div class="col-sm-12 multi-collapse collapse" id="fechareserva">
<div class="row">
<div class="col-sm-5">Fecha y Hora</div>
<div class="col-sm-3">
<div class="input-group">
{{ form_widget(form.fechareserva.date, {'attr': {'class': 'form-control form-control-sm',
'data-hello-target': 'reservafecha' }, 'disabled': 'disabled'}) }}
</div>
</div>
<div
class="col-sm-4">
{#{ form_label(form.fechareserva.time, 'Hora', {'label_attr': {'class': 'form-label'}}) }#}
{% set foo = "" %}
{% if not form.vars.valid %}
{% set foo = ' is-invalid'%}
{% endif %}
<div class="input-group">
{{ form_widget(form.fechareserva.time.hour, {'attr': {'class': 'form-select form-select-sm',
'data-hello-target': 'reservahora' }, 'disabled': 'disabled'}) }}
{{ form_widget(form.fechareserva.time.minute, {'attr': {'class': 'form-select form-select-sm',
'data-hello-target': 'reservaminuto' }, 'disabled': 'disabled'}) }}
</div>
</div>
{# {{ form_errors(form.fechareserva) }} #}
<div class="invalid-feedbacks">
<small class="text-danger">
<strong>{{ form_errors(form.fechareserva) }}</strong>
</small>
</div>
</div>
</div>
<div class="col-12">
{{ form_label(form.direccioncliente, 'Dirección', {'label_attr': {'class': 'form-label'}}) }}
<div class="input-group">
{{ form_widget(form.direccioncliente, {'attr': {'class': 'form-control form-control-sm',
'data-hello-target': 'addr',
'data-action': 'input->hello#limitInput',
'data-input-target': 'observaciones',
'data-max-length': '50'
}}) }}
<button class="btn btn-secondary btn-sm" type="button" id="button-addon">Localizar</button>
</div>
</div>
<div class="col-12">
{{ form_label(form.direccion2cliente, 'Observaciones', {'label_attr': {'class': 'form-label'}}) }}
{{ form_widget(form.direccion2cliente, {'attr': {'class': 'form-control',
'data-hello-target': 'complemento',
'placeholder': 'Conjunto, torre, Apartamento...' ,
'data-action': 'input->hello#limitInput',
'data-input-target': 'observaciones',
'data-max-length': '55'
}}) }}
</div>
{% if cliente is not empty %}
{% if cliente.es_cliente_bitcubo is defined %}
<div class="col-sm-12">
<p>Otras direcciones</p>
<div class="list-group" id="address">
{% for direccion in cliente.direcciones_bitcubo %}
{% if direccion.direccion|length > 7 %}
<button
type="button"
class="list-group-item list-group-item-action btn-sm list-group-item-dark"
data-action="hello#select"
data-direccion="{{ direccion.direccion|e('html_attr') }}"
data-complemento="{{ direccion.complemento|e('html_attr') }}"
>
{{ direccion.direccion }} <span><small>{{ direccion.complemento }}</small></span>
</button>
{% endif %}
{% endfor %}
</div>
</div>
{% else %}
{% if cliente is defined and 'direcciones' in cliente %}
<div class="col-sm-12">
<p>Otras direcciones</p>
<div class="list-group" id="address">
{# {% if cliente|length > 7 %}
<button type="button" class="list-group-item list-group-item-action btn-sm list-group-item-secondary active" data-action="hello#select">
{{ cliente }}
</button>
{% endif %} #}
{% for direccion in cliente.direcciones %}
{% if direccion.direccion1|length > 7 %}
<button
type="button"
class="list-group-item list-group-item-action btn-sm list-group-item-dark"
data-action="hello#select"
data-direccion="{{ direccion.direccion1|e('html_attr') }}"
data-complemento="{{ direccion.direccion2|e('html_attr') }}"
>
{{ direccion.direccion1 }} <span><small>{{ direccion.direccion2 }}</small></span>
</button>
{% endif %}
{# {% if item.direcciondelaotratabla is defined %}
{% if item.direcciondelaotratabla|length > 7 %}
<button type="button" class="list-group-item list-group-item-action btn-sm list-group-item-dark" data-action="hello#select">{{ item.direcciondelaotratabla }}</button>
{% endif %}
{% endif %} #}
{% endfor %}
</div>
</div>
{% endif %}
{% endif %}
{% endif %}
<hr/>
<h5>Datos de envío</h5>
<div class="col-sm-6">
{{ form_widget(form.nombre_receptor, {'attr': {'class': 'form-control form-control-sm',
'placeholder': 'Nombre del que recibe',
'data-action': 'input->hello#limitInput',
'data-input-target': 'nombrereceptor',
'data-max-length': '26'
}}) }}
</div>
<div class="col-sm-6">
{{ form_widget(form.telefono_receptor, {'attr': {'class': 'form-control form-control-sm',
'placeholder': 'Telefono del que recibe',
'data-action': 'input->hello#limitInput',
'data-input-target': 'telefonoreceptor',
'data-max-length': '10'
}}) }}
</div>
{# <div class="col-12">
{{ form_widget(form.observaciones_receptor, {'attr': {'class': 'form-control form-control-sm',
'placeholder': 'Observaciones',
'data-action': 'input->hello#limitInput',
'data-input-target': 'observacionesreceptor',
'data-max-length': '135'
}}) }}
</div> #}
</div>
<hr/>
{{ form_widget(form.sucursal) }}
{{ form_widget(form.save, {'attr': {'class': 'w-100 btn btn-primary btn-lg disabled'}}) }}
{{ form_end(form) }}
</div>