{#{% extends 'GreenPatioBundle::base-reservations.html.twig' %}#}
{% extends 'MDS/AvexpressBundle/base-files.html.twig' %}
{% block pagetitleinterno %}
<div class="page-title">
<h4><i class="icon-list position-left"></i> <span class="text-semibold">{% trans %}AV Express{% endtrans %}</span> - {% trans %}Expediente{% endtrans %}</h4>
</div>
{% endblock %}
{% block breadcrumbs %}
<ul class="breadcrumb">
<li><a href="/avexpress/filelist"><i class="icon-home2 position-left"></i>{% trans %}Home{% endtrans %}</a></li>
<li class="active"><i class="icon-plus-circle2 position-left"></i>{% trans %}Edit Reservations{% endtrans %}</li>
</ul>
{% endblock %}
{% block stylesheets %}
<style>
.bg-btn-gp {
background-color: #bdbf09!important;
border: none!important;
color: #fafffd!important;
padding: 10px;
}
.bg-btn-gp:hover {
background-color: #fafffd!important;
border: none!important;
color: #bdbf09!important;
}
</style>
{% endblock %}
{% block contentFile %}
<div class="row settings-page" id="client-client-subpage">
{% for flashMessage in app.session.flashbag.get('mensajeav') %}
<div class="hidden alertFlashMensaje" data-mensaje="{{ flashMessage }}"></div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('mensajeaverror') %}
<div class="hidden alertFlashMensajeError" data-mensajeerror="{{ flashMessage }}"></div>
{% endfor %}
<div class="panel panel-default">
<div class="panel-heading clearfix" style="padding: 10px">
<h5 class="panel-title pull-left" style="padding-top:7px;">
<i class="icon-pencil text-vivid_sky_blue"></i>
{% trans %}Editar Expediente{% endtrans %}
</h5>
<div class="btn-group pull-right">
{% if gpFile is defined %}
{% if gpFile is not empty %}
<a href="/venues/editsimple/{{ gpFile.id }}" target="_blank" class="btn bg-btn-gp btn-gl">{% trans %}Expediente Venues{% endtrans %} </a>
{% endif %}
{% endif %}
{% if htFile is defined %}
{% if htFile is not empty %}
<a href="/higotrigo/ht/file/{{ htFile.id }}/edit" target="_blank" class="btn bg-btn-orange_cat btn-gl">{% trans %}Expediente Catering{% endtrans %} </a>
{% endif %}
{% endif %}
{% if clientId != 0 %}
<a href="/avexpress/listpaydep/{{ id }}" class="btn bg-btn-rich_black btn-gl">{% trans %}Pagos y Proformas{% endtrans %} </a>
<a href="/avexpress/supplierlist/{{ id }}" class="btn bg-btn-lavender_gray btn-gl">{% trans %}Proveedores{% endtrans %} </a>
<a href="/avexpress/selinvoice/{{ id }}" class="btn bg-btn-limerick btn-gl" >{% trans %}Cotización{% endtrans %} </a>
{% endif %}
{% if clientId != 0 %}
<a href="/avexpress/filesummary/{{ id }}" class="btn bg-btn-vivid_sky_blue btn-gl">{% trans %}Resumen Económico{% endtrans %} </a>
{% endif %}
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<form name="ave_avexpress" method="post" action="/avexpress/fileupdate/{{ id }}" class="form-horizontal" role="form" autocomplete="off">
<div class="col-md-12 col-xs-12" ><strong class="text-vivid_sky_blue">
<legend class="border-teal-800">{% trans %}General data of the request{% endtrans %}</legend></strong>
</div>
<div class="col-md-12 col-xs-12">
<h4><strong>AV Express ID # {% if file.reservation is not null %} AV{{ file.reservation.id }} {% else %} F{{ id }} {% endif %} </strong></h4>
</div>
<div class="col-md-12 col-xs-12">
<div class="col-md-8 col-xs-6 margen-5">
<div class="col-md-6"><label class="control-label text-left">{% trans %}Title{% endtrans %}</label></div>
<div class="col-md-12"><input type="text" class="form-control" name="avexpress[title]" id="avexpress_title" value="{{ file.title }}"></div>
</div>
<div class="col-md-4 col-xs-6 margen-5">
<div class="col-md-6">
<label class="control-label text-left">{% trans %}Client{% endtrans %}</label>
</div>
<div class="col-md-12">
<select id="avexpress_client" name="avexpress[client]" class="form-control">
<option value="">{% trans %}Select a client{% endtrans %}</option>
{% for client in clients %}
<option value="{{ client.id }}" {{ client.id == clientId ? 'selected' : '' }}>
{{ client.name|capitalize }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="col-md-2 col-xs-12 margen-5">
<div class="col-md-6"><label class="control-label text-left">Proposal</label></div>
<div class="col-md-12"><input type="text" class="form-control" name="avexpress[idProposal]" id="avexpress_idProposal" value="{{ file.idProposal }}"></div>
</div>
<div class="col-md-2 col-xs-12 margen-5">
<div class="col-md-6"><label class="control-label text-left">{% trans %}Status{% endtrans %}</label></div>
<div class="col-md-12">
<select id="avexpress_status" name="avexpress[status]" class="form-control">
<option value="">{% trans %}Select a status{% endtrans %}</option>
{% if file.status == 'Bloqueo' %}
<option value="Bloqueo" selected="selected">BLOQUEO</option>
{% else %}
<option value="Bloqueo">BLOQUEO</option>
{% endif %}
{% if file.status == 'Confirmed' %}
<option value="Confirmed" selected="selected">CONFIRMADO</option>
{% else %}
<option value="Confirmed">CONFIRMADO</option>
{% endif %}
{% if file.status == 'Cotizado' %}
<option value="Cotizado" selected="selected">COTIZADO</option>
{% else %}
<option value="Cotizado">COTIZADO</option>
{% endif %}
{% if file.status == 'Invoiced' %}
<option value="Invoiced" selected="selected">FACTURADO</option>
{% else %}
<option value="Invoiced">FACTURADO</option>
{% endif %}
{% if file.status == 'Deleted' %}
<option value="Deleted" selected="selected">CANCELADO</option>
{% else %}
{% if file.reservation is null %}
<option value="Deleted">CANCELADO</option>
{% else %}
<option value="Deleted">SIN SERVICIO</option>
{% endif %}
{% endif %}
</select>
</div>
</div>
<div class="col-md-2 col-xs-12 margen-5">
<div class="col-md-6"><label class="control-label text-left">{% trans %}Destination{% endtrans %}</label></div>
<div class="col-md-12">
<select id="avexpress_destination" name="avexpress[destination]" class="form-control">
<option value="" selected="selected">{% trans %}Seleccione un Destino{% endtrans %}</option>
{% for destino in destinations %}
{% if file.destinoId == destino.id %}
<option value={{ destino.id }} selected="selected">{{ destino.title }}</option>
{% else %}
<option value={{ destino.id }}>{{ destino.title }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
<div class="col-md-2 col-xs-12 margen-5">
<label class="control-label">Fecha Inicio</label>
<input type="date" id="avexpress_dateStart" name="avexpress[dateStart]" value="{{ file.dateStart|date('Y-m-d') }}" class="form-control">
</div>
<div class="col-md-2 col-xs-12 margen-5">
<label class="control-label">Fecha Fin</label>
<input type="date" id="avexpress_dateEnd" name="avexpress[dateEnd]" value="{{ file.dateEnd|date('Y-m-d') }}" class="form-control"> {#required="required">#}
</div>
<div class="col-md-2 col-xs-12 margen-5">
{#<div class="col-md-9"></div>#}
<div class="col-md-12" style="padding-top: 20px"><a href="/avexpress/filelistbriefings/{{ id }}" class="btn bg-btn-vivid_sky_blue btn-gl">{% trans %}Ver Briefings{% endtrans %}</a></div>
</div>
<div class="col-md-12 col-xs-12 margen-5">
<div class="col-md-12 col-xs-12 margen-5">
<label class="control-label">Campo Extra</label>
<input type="text" id="avexpress_xtraFieldOne" name="avexpress[xtraFieldOne]" value="{{ file.xtraFieldOne }}" class="form-control" title="Usado para establecer la Orden de Compra. Este campo se presenta en facturas y proformas después de la dirección del cliente">
</div>
</div>
{% if gpFile is defined and gpFile is not empty %}
<div class="col-md-12 col-xs-12 margen-5">
<br>
<label class="control-label">Previsión de venta del espacio. ( Información susceptible a cambio, se recomienda consultar al agente )</label>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Opción</th>
<th>Salas</th>
<th>Precio</th>
</tr>
</thead>
<tbody>
{% for option in optionsGp %}
<tr>
<td>Opción {{ option['Opcion'] }}</td>
<td>{{ option['Sala'] }}</td>
<td>{{ option['Precio']|number_format(2, ',', '.') }} €</td>
</tr>
{% else %}
<tr>
<td colspan="3" class="text-center">No hay opciones disponibles</td>
</tr>
{% endfor %}
</tbody>
</table>
<br>
</div>
{% endif %}
<div class="col-md-12 col-xs-12 margen-5">
<div class="col-md-12"><label class="control-label text-left">{% trans %}Description{% endtrans %}</label></div>
<div class="col-md-12">
<textarea id="avexpress_description" name="avexpress[description]" class="form-control summernote" rows="7">{{ file.description }}</textarea>
{#<input type="text" class="form-control" name="avexpress[deposit]" id="avexpress_deposit" value="{{ file.deposit }}">#}
</div>
</div>
<div class="col-md-12 col-xs-12" >
<div class="col-md-3 col-xs-12" >
</div>
<div class="col-md-1 col-xs-12" style="margin-left: -50px; padding-top: 5px">
</div>
<div class="col-md-1 col-xs-12" ></div>
<div class="col-md-3 col-xs-12" >
</div>
<div class="col-md-1 col-xs-12" style="margin-left: -20px; padding-top: 5px">
</div>
</div>
<div class="col-md-12 col-xs-12" >
<div class="col-md-4 col-xs-12" >
<div class="col-md-12 col-xs-12" >
<div class="col-md-4 col-xs-12" >
</div>
<div class="col-md-1 col-xs-12" >
</div>
</div>
</div>
<div class="col-md-8 col-xs-12" style="padding-top: 0px; padding-left: 15px;padding-right: 15px">
</div>
<div class="col-md-1 col-xs-12" style="padding-top: 0px; padding-left: 15px;padding-right: 15px"></div>
<div class="col-md-7 col-xs-12" style="padding-top: 0px; padding-left: 15px;padding-right: 15px">
</div>
</div>
</div>
<div class="col-md-4 col-xs-12" style="padding-top: 5px; padding-left: 15px;padding-right: 15px"></div>
<div class="col-md-4 col-xs-12" style="padding-top: 5px; padding-left: 15px;padding-right: 15px">
<button type="submit" id="avexpress_description_save" name="avexpress[save]" class="btn bg-btn-limerick btn-block" style="width: 100%">{% trans %}Guardar{% endtrans %}</button>
</div>
<div class="col-md-4 col-xs-12" style="padding-top: 5px; padding-left: 15px;padding-right: 15px"></div>
</form>
<div class="col-md-12 col-xs-12" ><strong class="text-vivid_sky_blue">
<legend class="border-teal-800">{% trans %}Productos{% endtrans %}</legend></strong>
</div>
<div class="col-md-4 col-xs-12" style="padding-top: 25px; padding-left: 15px;padding-right: 15px"></div>
<div class="col-md-1 col-xs-12" style="padding-top: 25px; padding-left: 15px;padding-right: 15px"></div>
<div class="col-md-2 col-xs-12" style="padding-top: 0px; padding-left: 15px;padding-right: 15px">
<a target="_self" class="btn bg-btn-vivid_sky_blue btn-block" href="/avexpress/productfilelistmultiple/{{ id }}" title="Añadir varios">Añadir desde el Listado</a>
</div>
<div class="col-md-4 col-xs-12" style="padding-top: 25px; padding-left: 15px;padding-right: 15px"></div>
</div>
{# Proformas - Presupuestos #}
{% if proformas is not empty %}
<div class="panel panel-default">
<div class="panel-body">
<div class="col-sm-12">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-body text-center">
<h4>{% trans %}Proformas (Presupuestos){% endtrans %}</h4>
</div>
{% if proformas is not empty %}
<div class="col-xs-12">
<br>
<br>
</div>
<div class="col-xs-12 margen-10">
{% for pro in proformas %}
<div class="panel panel-flat">
<div class="panel-body">
<br>
<br>
<div class="row">
<div class="col-xs-12">
<div class="col-sm-2">{% trans %}Documento{% endtrans %}</div>
<div class="col-sm-1">{% trans %}Date{% endtrans %}</div>
<div class="col-sm-1">{% trans %}Neto{% endtrans %}</div>
<div class="col-sm-1">{% trans %}IVA{% endtrans %}</div>
<div class="col-sm-1">{% trans %}Total{% endtrans %}</div>
<div class="col-sm-2 text-center"></div>
<div class="col-sm-4 text-center">
{% trans %}Actions{% endtrans %}
</div>
</div>
<div class="col-sm-2 margen-5">Proforma {{ pro.id }}</div>
<div class="col-sm-1 margen-5">{{ pro.date|date('d/m/Y') }}</div>
<div class="col-sm-1 margen-5">{{ pro.neto|number_format(2, '.', ',') }} €</div>
<div class="col-sm-1 margen-5">{{ pro.bases_imponibles|number_format(2, '.', ',') }} €</div>
<div class="col-sm-1 margen-5">{{ pro.total|number_format(2, '.', ',') }} €</div>
<div class="col-sm-2 margen-5"></div>
<div class="col-sm-2 margen-5">
<a target="_self" class="btn bg-btn-vivid_sky_blue btn-block padding-3" href="/avexpress/selproforma/{{ pro.id }}">Cotizar desde proforma</a>
</div>
<div class="col-sm-1 margen-5">
<a target="_self" class="btn bg-btn-rich_black btn-block padding-3" href="/avexpress/viewproforma/{{ pro.id }}">Ver</a>
</div>
<div class="col-sm-1 margen-5">
{#<a target="_self" class="btn bg-btn-trash btn-block padding-3" href="/avexpress/discardproforma/{{ pro.id }}">Descartar</a>#}
<a href="/avexpress/discardproforma/{{ pro.id }}" class="btn bg-btn-trash btn-block padding-3 sweet_warning">Descartar</a>
</div>
<div class="col-sm-12 margen-5"></div>
<div class="col-sm-12 margen-5"></div>
<div class="col-sm-12 margen-5"></div>
<div class="col-sm-12 margen-5">
<form name="ave_avexpressbundle_productfileproformagrid" method="post" action="/avexpress/updateproductfilegrid/" class="form-horizontal" role="form" autocomplete="off">
<input type="hidden" class="form-control" name="fileId" id="fileId" value="{{ id }}">
{% for item in pro.itemsInProforma %}
<div class="col-md-12">
<div class="col-md-4"><label class="control-label text-center">Producto</label></div>
{#<div class="col-md-3"><label class="control-label text-center">Descripcion</label></div>#}
<div class="col-md-2"><label class="control-label text-center">Precio Unitario</label></div>
<div class="col-md-1"><label class="control-label text-center">Cantidad</label></div>
<div class="col-md-1"><label class="control-label text-center">Días</label></div>
<div class="col-md-2"><label class="control-label text-center">Precio sin IVA</label></div>
<div class="col-md-1"><label class="control-label text-center">Detalles</label></div>
<div class="col-md-1"><label class="control-label text-center">Borrar</label></div>
</div>
<div class="col-md-12 no-padding">
<div class="col-md-4"><input type="text" class="form-control" name="product[{{ item.id }}][name]" id="product_{{ item.id }}_name" value="{{ item.productName }}"></div>
{#<div class="col-md-3"><input type="text" class="form-control" name="product[{{ item.id }}][description]" id="product_{{ item.id }}_description" value="{{ item.description }}"></div>#}
{#<div class="col-md-2"><time type="datetime" class="form-control" name="product[{{ item.id }}][date]" id="product_{{ item.id }}_dateStart">{{ item.dateStart|date('d/m/Y') }}</time></div>#}
<div class="col-md-2"><input type="number" step="any" class="form-control" name="product[{{ item.id }}][price]" id="product_{{ item.id }}_servicePrice" value="{{ item.servicePrice }}"></div>
<div class="col-md-1"><input type="number" step="any" class="form-control" name="product[{{ item.id }}][units]" id="product_{{ item.id }}_units" value="{{ item.units }}"></div>
<div class="col-md-1"><input type="number" step="any" class="form-control" name="product[{{ item.id }}][days]" id="product_{{ item.id }}_days" value="{{ item.days }}"></div>
<div class="col-md-2"><input type="text" class="form-control" name="product[{{ item.id }}][subTotalPrice]" id="product_{{ item.id }}_servicePrice" value="{{ item.subTotalPrice }}" disabled></div>
<div class="col-md-1">
<a target="_self" style="height: 32px; padding-top: 5px" class="btn bg-btn-vivid_sky_blue btn-block icon-notebook padding-3" href="/avexpress/productfileedit/{{ item.id }}" title="Editar este elemento"></a>
</div>
<div class="col-sm-1">
{% if item.id != 0 %}
<a target="_self" style="height: 32px; padding-top: 5px" class="btn bg-btn-trash btn-block icon-trash padding-3" href="/avexpress/productfileproformadelete/{{ item.id }}" title="Eliminar este elemento de la proforma"></a>
{% else %}
<a target="_self" class="btn bg-btn-trash btn-block icon-trash padding-3" href="/avexpress/edit/{{ id }}" title="Antes debe guardar el expediente"></a>
{% endif %}
</div>
<div class="col-md-2"></div>
</div>
{% endfor %}
<div class="col-md-4 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px"></div>
<div class="col-md-4 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px">
<div class="form-group form-group-material">
<div class="input-group teal">
<button type="submit" id="avexpress_save" name="avexpress[save]" class="btn bg-btn-limerick btn-block">Guardar Proforma</button>
</div>
</div>
</div>
<div class="col-md-4 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px"></div>
</form>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endif %}
{# Proformas - Presupuestos #}
{% if numeroItems > 0 %}
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-body">
<div class="col-md-12 col-xs-12" ><strong class="text-vivid_sky_blue">
<legend class="border-teal-800">{% trans %}EXPEDIENTE{% endtrans %}</legend></strong>
</div>
<div class="col-md-2"></div>
<div class="col-md-12"></div>
<div class="col-md-12">
<div class="col-md-9"></div>
<div class="col-md-3">
{#<a target="_self" class="btn bg-btn-trash btn-block padding-3" href="/avexpress/cleanproductfile/{{ id }}">Limpiar el expediente</a>#}
<a href="/avexpress/cleanproductfile/{{ id }}" class="btn bg-btn-trash btn-block padding-3 sweet_warning">Limpiar el expediente</a>
</div>
</div>
<div class="col-md-12">
<br>
</div>
<form name="ave_avexpressbundle_productfilegrid" method="post" action="/avexpress/updateproductfilegrid/" class="form-horizontal" role="form" autocomplete="off">
<input type="hidden" class="form-control" name="fileId" id="fileId" value="{{ id }}">
{% for item in arrayProductFile %}
<div class="col-md-12">
<div class="col-md-4"><label class="control-label text-center">Producto</label></div>
{#<div class="col-md-3"><label class="control-label text-center">Descripcion</label></div>#}
<div class="col-md-2"><label class="control-label text-center">Precio Unitario</label></div>
<div class="col-md-1"><label class="control-label text-center">Cantidad</label></div>
<div class="col-md-1"><label class="control-label text-center">Días</label></div>
<div class="col-md-2"><label class="control-label text-center">Precio sin IVA</label></div>
<div class="col-md-1"><label class="control-label text-center">Detalles</label></div>
<div class="col-md-1"><label class="control-label text-center">Borrar</label></div>
</div>
<div class="col-md-12 no-padding">
<div class="col-md-4"><input type="text" class="form-control" name="product[{{ item.id }}][name]" id="product_{{ item.id }}_name" value="{{ item.productName }}"></div>
{#<div class="col-md-3"><input type="text" class="form-control" name="product[{{ item.id }}][description]" id="product_{{ item.id }}_description" value="{{ item.description }}"></div>#}
{#<div class="col-md-2"><time type="datetime" class="form-control" name="product[{{ item.id }}][date]" id="product_{{ item.id }}_dateStart">{{ item.dateStart|date('d/m/Y') }}</time></div>#}
<div class="col-md-2"><input type="number" step="any" class="form-control" name="product[{{ item.id }}][price]" id="product_{{ item.id }}_servicePrice" value="{{ item.servicePrice }}"></div>
<div class="col-md-1"><input type="number" step="any" class="form-control" name="product[{{ item.id }}][units]" id="product_{{ item.id }}_units" value="{{ item.qty }}"></div>
<div class="col-md-1"><input type="number" step="any" class="form-control" name="product[{{ item.id }}][days]" id="product_{{ item.id }}_days" value="{{ item.days }}"></div>
<div class="col-md-2"><input type="text" class="form-control" name="product[{{ item.id }}][subTotalPrice]" id="product_{{ item.id }}_servicePrice" value="{{ item.subTotalPrice }}" disabled></div>
<div class="col-md-1">
<a target="_self" style="height: 32px; padding-top: 5px" class="btn bg-btn-vivid_sky_blue btn-block icon-notebook padding-3" href="/avexpress/productfileedit/{{ item.id }}" title="Editar este elemento"></a>
</div>
<div class="col-sm-1">
{% if item.id != 0 %}
<a target="_self" style="height: 32px; padding-top: 5px" class="btn bg-btn-trash btn-block icon-trash padding-3" href="/avexpress/productfiledelete/{{ item.id }}" title="Eliminar este elemento"></a>
{% else %}
<a target="_self" class="btn bg-btn-trash btn-block icon-trash padding-3" href="/avexpress/edit/{{ id }}" title="Antes debe guardar el expediente"></a>
{% endif %}
</div>
<div class="col-md-2"></div>
</div>
{% endfor %}
<div class="col-md-4 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px"></div>
<div class="col-md-4 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px">
<button type="submit" id="avexpress_save" name="avexpress[save]" class="btn bg-btn-limerick btn-block">Guardar Expediente</button>
</div>
<div class="col-md-4 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px"></div>
</form>
</div>
</div>
</div>
{% endif %}
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-body text-center">
<div class="col-sm-12 ">
<div class="col-sm-1"></div>
<div class="col-sm-2"><b class="text-green_av ">{% trans %}Sale Client Global{% endtrans %} (Productos)</b><br><b> {{ totales_global_con_iva|number_format(2, '.', ',') }} €</b></div>
<div class="col-sm-2"><b class="text-green_av ">{% trans %}IVA{% endtrans %} (Productos)</b><br><b> {{ totales_global_iva|number_format(2, '.', ',') }} €</b></div>
<div class="col-sm-2"><b class="text-green_av ">{% trans %}Sale No Vat{% endtrans %} (Productos)</b><br><b> {{ totales_global_neto|number_format(2, '.', ',') }} €</b></div>
<div class="col-sm-2"><b class="text-green_av ">{% trans %}Beneficio €{% endtrans %} </b><br><b> {{ benefitEuro|number_format(2, '.', ',') }} €</b></div>
<div class="col-sm-2"><b class="text-green_av ">{% trans %}Beneficio %{% endtrans %} </b><br><b> {{ benefitPerc|number_format(2, '.', ',') }} %</b></div>
<div class="col-sm-1"></div>
</div>
</div>
</div>
</div>
{% if true %}
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-body">
<div class="col-sm-12 ">
<div class="col-md-12 col-xs-12" ><strong class="text-vivid_sky_blue text-left">
<legend class="border-teal-800">{% trans %}Observaciones para las Proformas y Facturas{% endtrans %}</legend></strong>
</div>
<form name="ave_avexpressbundle_template_maker" method="post" action="/avexpress/updatefilecomments/{{ id }}" class="form-horizontal" role="form" autocomplete="off">
<input type="hidden" class="form-control" name="fileId" id="fileId" value="{{ id }}">
<div class="col-md-9">
<div class="col-md-12"><label class="control-label text-left">{% trans %}Observaciones{% endtrans %}</label></div>
<div class="col-md-12 text-center">
<textarea id="comments" name="comments" class="form-control summernote" rows="7">{{ file.comments }}</textarea>
</div>
</div>
<div class="col-md-3">
<div class="col-md-12 col-xs-12" style="padding-top: 15px; padding-left: 0px">
<br>
<br>
</div>
<div class="col-md-12 col-xs-12" style="padding-top: 15px; padding-left: 0px">
<div class="checkbox checkbox-switchery switchery-lg switchery-double">
{% if file.commentsInPro %}
<input type="checkbox" class="switchery-info boolDelete" id="boolToInvoice_lounge" name="chkCommentsToPro" checked="checked">
{% else %}
<input type="checkbox" class="switchery-info boolDelete" id="boolToInvoice_lounge" name="chkCommentsToPro">
{% endif %}
<label class="control-label text-center">Mostrar en Proformas</label>
</div>
</div>
<div class="col-md-12 col-xs-12" style="padding-top: 15px; padding-left: 0px">
<div class="checkbox checkbox-switchery switchery-lg switchery-double">
{% if file.commentsInInv %}
<input type="checkbox" class="switchery-info boolDelete" id="boolToInvoice_lounge" name="chkCommentsToInv" checked="checked">
{% else %}
<input type="checkbox" class="switchery-info boolDelete" id="boolToInvoice_lounge" name="chkCommentsToInv">
{% endif %}
<label class="control-label text-center">Mostrar en Facturas</label>
</div>
</div>
</div>
<div class="col-md-4 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px"></div>
<div class="col-md-4 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px">
<button type="submit" id="avexpress_comments_save" name="avexpress_comments[save]" class="btn bg-btn-limerick btn-block" style="width: 100%">Guardar Observaciones</button>
</div>
<div class="col-md-4 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px"></div>
</form>
</div>
</div>
</div>
</div>
{% endif %}
{# --- GENERADOR DE PLANTILLA --- #}
{% if numeroItems > 0 %}
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-body text-center">
<div class="col-sm-12 ">
<div class="col-md-12 col-xs-12" ><strong class="text-vivid_sky_blue text-left">
<legend class="border-teal-800">{% trans %}Convertir en plantilla{% endtrans %}</legend></strong>
</div>
<form name="ave_avexpressbundle_template_maker" method="post" action="/avexpress/templateadd/" class="form-horizontal" role="form" autocomplete="off">
<input type="hidden" class="form-control" name="fileId" id="fileId" value="{{ id }}">
<input type="hidden" name="_token" value="{{ csrf_token('add_template' ~ file.id) }}">
<div class="col-md-1"></div>
<div class="col-md-6">
<label class="control-label text-center">Nombre</label>
<input type="text" class="form-control" name="template[name]" id="template_name" value="" required = "required">
</div>
<div class="col-md-3 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px">
<div class="form-group form-group-material">
<div class="input-group teal">
<button type="submit" id="avexpress_save" name="avexpress[save]" class="btn bg-btn-vivid_sky_blue btn-block">Guardar como Plantilla</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endif %}
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-body">
<div class="col-md-12 col-xs-12" ><strong class="text-vivid_sky_blue">
<legend class="border-teal-800">{% trans %}FACTURACION{% endtrans %}</legend></strong>
</div>
<div class="col-sm-12 text-center">
<div class="col-sm-12">
<div class="col-sm-1"><b>No.</b></div>
<div class="col-sm-2"><b>Fecha de Facturación</b></div>
{#<div class="col-sm-3"><b>Nombre Evento</b></div>#}
<div class="col-sm-3"><b>Cliente</b></div>
<div class="col-sm-1"><b>Neto</b></div>
<div class="col-sm-1"><b>Iva</b></div>
<div class="col-sm-1"><b>Total</b></div>
<div class="col-sm-2"><b>Balance Restante</b></div>
<div class="col-sm-1"><b>Acciones</b></div>
</div>
<div class="col-sm-12">
<hr>
</div>
{% set totalBalance = 0 %}
{% for factura in facturas %}
{#{% if factura.type == 'Invoice Deposit' %}#}
{% set totalBalance = totalBalance + factura.balance %}
{#{% else %}#}
{#{% set totalBalance = totalBalance + factura.balance %}#}
{#{% endif %}#}
<div class="col-sm-12 margen-10">
<div class="col-sm-1">
{% if factura.type == 'Invoice' %}
A{{ factura.id }}
{% else %}
{% if factura.type == 'Factura de Deposito' %}
{#Factura de deposito#}
<p style="color:green">{{ factura.id }}</p>
{% else %}
{#Factura rectificativa#}
<p style="color:red">R{{ factura.id }} (A{{ factura.invoiceToRec }})</p>
{% endif %}
{% endif %}
</div>
<div class="col-sm-2">
{% if factura.type == 'Invoice' %}
{{ factura.dateAt|date("d/m/Y") }}
{% else %}
{% if factura.type == 'Factura de Deposito' %}
{#Factura de deposito#}
<p style="color:green">{{ factura.dateAt|date("d/m/Y") }}</p>
{% else %}
{#Factura rectificativa#}
<p style="color:red">{{ factura.dateAt|date("d/m/Y") }}</p>
{% endif %}
{% endif %}
</div>
{#<div class="col-sm-3">{{ factura.number }}</div>#}
<div class="col-sm-3">
{#{{ dump(clientSelected.name) }}#}
{% if factura.type == 'Invoice' %}
{{ clientSelected.name }}
{% else %}
{% if factura.type == 'Factura de Deposito' %}
{#Factura de deposito#}
<p style="color:green">{{ clientSelected.name }}</p>
{% else %}
{#Factura rectificativa#}
<p style="color:red">{{ clientSelected.name }}</p>
{% endif %}
{% endif %}
</div>
<div class="col-sm-1">
{% if factura.type == 'Invoice' %}
{{ factura.totalNet|number_format(2, '.', ',') }}
{% else %}
{% if factura.type == 'Factura de Deposito' %}
{#Factura de deposito#}
<p style="color:green">{{ factura.totalNet|number_format(2, '.', ',') }}</p>
{% else %}
{% if factura.type == 'Invoice Deposit Rec' %}
{#Factura rectificativa de deposito#}
<p style="color:red">{{ factura.totalNet|number_format(2, '.', ',') }}</p>
{% else %}
{#Factura rectificativa#}
<p style="color:red">{{ factura.totalNet|number_format(2, '.', ',') }}</p>
{% endif %}
{% endif %}
{% endif %}
</div>
<div class="col-sm-1">
{% if factura.type == 'Invoice' %}
{{ factura.vat|number_format(2, '.', ',') }}
{% else %}
{% if factura.type == 'Factura de Deposito' %}
{#Factura de deposito#}
<p style="color:green">{{ factura.vat|number_format(2, '.', ',') }}</p>
{% else %}
{% if factura.type == 'Invoice Deposit Rec' %}
{#Factura rectificativa de deposito#}
<p style="color:red">{{ factura.vat|number_format(2, '.', ',') }}</p>
{% else %}
{#Factura rectificativa#}
<p style="color:red">{{ factura.vat|number_format(2, '.', ',') }}</p>
{% endif %}
{% endif %}
{% endif %}
</div>
<div class="col-sm-1">
{% if factura.type == 'Invoice' %}
{{ factura.total|number_format(2, '.', ',') }}
{% else %}
{% if factura.type == 'Factura de Deposito' %}
{#Factura de deposito#}
<p style="color:green">{{ factura.total|number_format(2, '.', ',') }}</p>
{% else %}
{% if factura.type == 'Invoice Deposit Rec' %}
{#Factura rectificativa de deposito#}
<p style="color:red">{{ factura.total|number_format(2, '.', ',') }}</p>
{% else %}
{#Factura rectificativa#}
<p style="color:red">{{ factura.total|number_format(2, '.', ',') }}</p>
{% endif %}
{% endif %}
{% endif %}
</div>
<div class="col-sm-2">
{% if factura.type == 'Invoice' %}
{{ factura.balance|number_format(2, '.', ',') }}
{% else %}
{% if factura.type == 'Factura de Deposito' %}
{#Factura de deposito#}
<p style="color:green">{{ factura.balance|number_format(2, '.', ',') }}</p>
{% else %}
{#Factura rectificativa#}
<p style="color:red">{{ factura.balance|number_format(2, '.', ',') }}</p>
{% endif %}
{% endif %}
</div>
<div class="col-sm-1">
{#{% if factura.master == 'master' %}#}
{#<a class="btn btn-success btn-xs" href="/avexpress/invoice/{{ factura.reservationId }}">{% trans %}Go{% endtrans %}</a>#}
{#{% else %}#}
{#<a class="btn btn-success btn-xs" href="/avexpress/invoicedeposit/invoice/{{ factura.reservationId }}/{{ factura.master }}">{% trans %}Go{% endtrans %}</a>#}
{#{% endif %}#}
{% if factura.type == 'Invoice' %}
<a class="btn bg-btn-green_av btn-xs" href="/avexpress/viewinvoice/{{ factura.id }}">{% trans %}Go{% endtrans %}</a>
{% else %}
{% if factura.type == 'Factura de Deposito' %}
{#Factura de deposito#}
<a class="btn bg-btn-green_av btn-xs" href="/avexpress/viewinvoicedeposit/{{ factura.id }}">{% trans %}Go{% endtrans %}</a>
{% else %}
{% if factura.type == 'Invoice Rec' %}
{#Factura rectificativa#}
<a class="btn bg-btn-green_av btn-xs" href="/avexpress/viewinvoicerec/{{ factura.id }}">{% trans %}Go{% endtrans %}</a>
{% else %}
{% if factura.type == 'Factura Rectificativa de Deposito' %}
{#Factura de deposito rectificativa#}
<a class="btn bg-btn-green_av btn-xs" href="/avexpress/viewinvoicedepositrec/{{ factura.id }}">{% trans %}Go{% endtrans %}</a>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
{% endfor %}
{% for item in paymentNotIvoiced %}
{% if item.invoiceId is empty %}
{% set totalBalance = totalBalance - item.Amount %}
{% else %}
{% set totalBalance = totalBalance - 0 %}
{% endif %}
<div class="col-sm-12 margen-10">
<div class="col-sm-1"></div>
<div class="col-sm-2">
<p style="color:blue">{{ item.DatePayAt|date("d/m/Y") }}</p>
</div>
<div class="col-sm-3">
<p style="color:blue">{{ item.WayToPay }}</p>
</div>
<div class="col-sm-1"></div>
<div class="col-sm-1"></div>
<div class="col-sm-1"></div>
<div class="col-sm-2">
{% if item.invoiceId is empty %}
<p style="color:blue">-{{ (item.Amount)|number_format(2, '.', ',') }}</p>
{% else %}
<p style="color:blue">-{{ (item.AmountTotal)|number_format(2, '.', ',') }}</p>
{% endif %}
</div>
<div class="col-sm-1"></div>
</div>
{% endfor %}
<div class="col-sm-12">
<hr>
</div>
<div class="col-sm-12">
<div class="col-sm-offset-6 col-sm-1"><b>Neto</b><br>{{ resultados.totalNeto|number_format(2, '.', ',') }}</div>
<div class="col-sm-1"><b>Iva</b><br>{{ resultados.vat|number_format(2, '.', ',') }}</div>
<div class="col-sm-1"><b>Total</b><br>{{ resultados.total|number_format(2, '.', ',') }}</div>
<div class="col-sm-2"><b>Balance Restante</b><br>{{ totalBalance|number_format(2, '.', ',') }}</div>
</div>
</div>
</div>
</div>
{# Panel flotante de totales #}
<div class="navbar-fixed-bottom bg-vivid_sky_blue text-mint_cream" style="left: 290px; right: 10px; padding: 15px; border-top: 2px solid #fff; z-index: 9999;">
<div class="container-fluid text-mint_cream text-center">
<div class="row" style="padding: 10px 0;"> {# El padding es casi obligatorio para que no se pegue al borde #}
<div class="col-xs-4"><b>{% trans %}Sale Client Global{% endtrans %}</b><br><b> {{ sumatoria_totales_global_con_iva|number_format(2, '.', ',') }} € </b></div>
<div class="col-xs-4"><b>{% trans %}IVA{% endtrans %}</b><br><b> {{ sumatoria_totales_global_iva|number_format(2, '.', ',') }} €</b></div>
<div class="col-xs-4"><b>{% trans %}Sale No Vat{% endtrans %}</b><br><b> {{ sumatoria_totales_global_neto|number_format(2, '.', ',') }} €</b></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('assets/js/plugins/editors/summernote/summernote.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/croppie/croppie.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/forms/styling/switchery.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/loaders/blockui.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/forms/selects/select2.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/avexpress/edit-files.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/datetime.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/avexpress/description.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/avexpress/add-budgets.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/proposal/switchery-proposal.js') }}"></script>
{% endblock %}