{#{% 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 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="col-xs-12 col-md-12" style="padding-top: 0px;">
<br>
<div class="col-xs-12">
<div class="col-sm-12 text-right">
{% if gpFile is defined %}
{% if gpFile is not empty %}
<a href="/reservations-greenpatio/editsimple/{{ gpFile.id }}" target="_blank" class="btn btn-cyan btn-gl">{% trans %}Expediente asociado de Green Patio{% endtrans %} <i class="icon-sun3 position-right"></i></a>
{% endif %}
{% endif %}
{% if htFile is defined %}
{% if htFile is not empty %}
<a href="/higotrigo/ht/file/{{ htFile.id }}/edit" target="_blank" class="btn btn-cyan btn-gl">{% trans %}Expediente asociado de Higo&Trigo{% endtrans %} <i class="icon-basket position-right"></i></a>
{% endif %}
{% endif %}
</div>
<div class="col-sm-12 text-right">
{% if clientId != 0 %}
<a href="/avexpress/listpaydep/{{ id }}" class="btn btn-info btn-gl">{% trans %}Pagos y Proformas{% endtrans %} <i class="icon-coin-euro position-right"></i></a>
<a href="/avexpress/supplierlist/{{ id }}" class="btn btn-info btn-gl">{% trans %}Proveedores{% endtrans %} <i class="icon-people position-right"></i></a>
<a href="/avexpress/selinvoice/{{ id }}" class="btn bg-brown-600 btn-gl" >{% trans %}Cotización{% endtrans %}</a>
{% endif %}
<a href="/avexpress/productlist" class="btn btn-info btn-gl">{% trans %}Listado de Productos{% endtrans %} <i class="icon-list position-right"></i></a>
<a href="/avexpress/filelist" class="btn btn-info btn-gl">{% trans %}Listado de Expedientes{% endtrans %} <i class="icon-book position-right"></i></a>
{% if clientId != 0 %}
<a href="/avexpress/filesummary/{{ id }}" class="btn btn-info btn-gl">{% trans %}Resumen Económico{% endtrans %} <i class="icon-coin-euro position-right"></i></a>
{% endif %}
<a href="/avexpress/fileadd" class="btn btn-info btn-gl">{% trans %}Nuevo expediente{% endtrans %} <i class="icon-plus-circle2 position-right"></i></a>
</div>
<div class="col-sm-12 margen-15"></div>
<div class="col-sm-12 margen-15">
<div class="panel">
<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-info">
<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">
{#<input type="text" class="form-control" name="avexpress[client]" id="avexpress_client" value="{{ file.client }}">#}
<select id="avexpress_client" name="avexpress[client]" class="form-control">
<option value="">{% trans %}Select a client{% endtrans %}</option>
{% for client in clients %}
{% if client.Id == clientId %}
<option value="{{ client.id }}" selected="selected">{{ client.name|capitalize }} </option>
{% else %}
<option value="{{ client.id }}">{{ client.name|capitalize }} </option>
{% endif %}
{% 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 %}
<option value="Deleted">CANCELADO</option>
{% endif %}
</select>
</div>
</div>
{#<div class="col-md-3 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('d/m/Y') }}" class="form-control"> #}{#required="required">#}
{#</div>#}
{#<div class="col-md-3 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('d/m/Y') }}" class="form-control"> #}{#required="required">#}
{#</div>#}
{#<div class="col-md-2 col-xs-12 margen-5">#}
{#<div class="col-md-6"><label class="control-label text-left">{% trans %}Anticipo{% endtrans %}</label></div>#}
{#<div class="col-md-12"><input type="text" class="form-control" name="avexpress[advancePayment]" id="avexpress_advancePayment" value="{{ file.advancePayment }}"></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-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>
{#<div class="col-md-1 col-xs-12 margen-5">#}
{#<div class="col-md-12"><label class="control-label text-left">{% trans %}Personas total{% endtrans %}</label></div>#}
{#<div class="col-md-12"><input type="text" class="form-control" name="avexpress[pax]" id="avexpress_pax" value="{{ file.pax }}"></div>#}
{#</div>#}
{#<div class="col-md-2 col-xs-12 margen-5">#}
{#<div class="col-md-6"><label class="control-label text-left">{% trans %}Option{% endtrans %}</label></div>#}
{#<div class="col-md-12">#}
{#<select id="avexpress_priority" name="avexpress[priority]" class="form-control">#}
{#<option value="">{% trans %}Select a status{% endtrans %}</option>#}
{#{% if file.priority == 'Bloqueo' %}<option value="0" selected="selected">AUTOMATICO</option>{% else %}<option value="0">AUTOMATICO</option>{% endif %}#}
{#{% if file.priority == '1' %}<option value="1" selected="selected">1</option>{% else %}<option value="1">1</option>{% endif %}#}
{#{% if file.priority == '2' %}<option value="2" selected="selected">2</option>{% else %}<option value="2">2</option>{% endif %}#}
{#{% if file.priority == '3' %}<option value="3" selected="selected">3</option>{% else %}<option value="3">3</option>{% endif %}#}
{#{% if file.priority == '4' %}<option value="4" selected="selected">4</option>{% else %}<option value="4">4</option>{% endif %}#}
{#{% if file.priority == '5' %}<option value="5" selected="selected">5</option>{% else %}<option value="5">5</option>{% endif %}#}
{#{% if file.priority == '6' %}<option value="6" selected="selected">6</option>{% else %}<option value="6">6</option>{% endif %}#}
{#{% if file.priority == '7' %}<option value="7" selected="selected">7</option>{% else %}<option value="7">7</option>{% endif %}#}
{#{% if file.priority == '8' %}<option value="8" selected="selected">8</option>{% else %}<option value="8">8</option>{% endif %}#}
{#{% if file.priority == '9' %}<option value="9" selected="selected">9</option>{% else %}<option value="9">9</option>{% endif %}#}
{#{% if file.priority == '10' %}<option value="10" selected="selected">10</option>{% else %}<option value="10">10</option>{% endif %}#}
{#</select>#}
{#</div>#}
{#</div>#}
{#<div class="col-md-2 col-xs-12 margen-5">#}
{#<div class="col-md-12"><label class="control-label text-left">{% trans %}Deposit{% endtrans %}</label></div>#}
{#<div class="col-md-12"><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 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">
<div class="form-group form-group-material">
<div class="input-group teal">
<span class="input-group-addon bg-teal-800"><i class="icon-floppy-disk"></i></span>
<button type="submit" id="avexpress_description_save" name="avexpress[save]" class="btn bg-green-600 btn-block">{% trans %}Guardar y Sincronizar{% endtrans %}</button>
</div>
</div>
</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-info">
<legend class="border-teal-800">{% trans %}Productos{% endtrans %}</legend></strong>
</div>
{#<form name="ave_avexpress_products" method="post" action="/avexpress/productfileadd/" class="form-horizontal" role="form" autocomplete="off">#}
{#<input type="hidden" id="productfile_id" name="productfile[fileId]" value="{{ id }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>#}
{#<div class="col-md-3 col-xs-12">#}
{#<div class="col-md-12"><label class="control-label">{% trans %}Productos Precargados{% endtrans %} *</label></div>#}
{#<div class="col-md-12">#}
{#<select id="avexpress_productosPrecargados" name="productfile[productId]" class="form-control" required="required">#}
{#<option value="">{% trans %}Seleccione una producto{% endtrans %}</option>#}
{#{% for product in products %}#}
{#<option value="{{ product.id }}">{{ product.name|capitalize }} </option>#}
{#{% endfor %}#}
{#</select>#}
{#</div>#}
{#</div>#}
{#<div class="col-md-2 col-xs-12 margen-5">#}
{#<label class="control-label">{% trans %}Date{% endtrans %}:</label>#}
{#<input type="date" id="productfile_date" name="productfile[dateStart]" value="" class="form-control">#}{#required="required">#}
{#</div>#}
{#<div class="col-md-2 col-xs-12 margen-5">#}
{#<div class="col-md-12"><label class="control-label">{% trans %}Price{% endtrans %}</label></div>#}
{#<div class="col-md-12"><input type="text" class="form-control" name="productfile[servicePrice]" id="productfile_price" value=""></div>#}
{#</div>#}
{#<div class="col-md-1 col-xs-12 margen-5">#}
{#<div class="col-md-12"><label class="control-label">{% trans %}Pax{% endtrans %}</label></div>#}
{#<div class="col-md-12"><input type="text" class="form-control" name="productfile[pax]" id="productfile_pax" value=""></div>#}
{#</div>#}
{#<div class="col-md-1 col-xs-12 margen-5">#}
{#<div class="col-md-12"><label class="control-label">{% trans %}Inicio{% endtrans %}</label></div>#}
{#<div class="col-md-12"><input type="text" class="form-control" name="productfile[hourStart]" id="productfilehourStart" value="" placeholder="00:00"></div>#}
{#</div>#}
{#<div class="col-md-1 col-xs-12 margen-5">#}
{#<div class="col-md-12"><label class="control-label">{% trans %}Fin{% endtrans %}</label></div>#}
{#<div class="col-md-12"><input type="text" class="form-control" name="productfile[hourEnd]" id="productfile_hourEnd" value="" placeholder="00:00"></div>#}
{#</div>#}
{#<div class="col-md-10 col-xs-12" style="padding-top: 5px; padding-left: 15px;padding-right: 15px"></div>#}
{#<div class="col-md-2 col-xs-12" style="padding-top: 25px; padding-left: 15px;padding-right: 15px">#}
{#<div class="form-group form-group-material">#}
{#<div class="input-group teal">#}
{#<span class="input-group-addon bg-info-800"><i class="icon-plus22"></i></span>#}
{#<button type="submit" id="avexpress_productfile_save" name="productfile[save]" class="btn bg-info-600 btn-block">{% trans %}Add{% endtrans %}</button>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#</form>#}
<div class="col-md-4 col-xs-12" style="padding-top: 25px; padding-left: 15px;padding-right: 15px"></div>
<div class="col-md-4 col-xs-12" style="padding-top: 0px; padding-left: 15px;padding-right: 15px">
<a target="_self" class="btn bg-orange-600 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>
</div>
{# Proformas - Presupuestos #}
{% if proformas is not empty %}
<div class="panel">
<div class="panel-body">
<div class="col-sm-12 margen-15">
<div class="col-sm-12">
<div class="panel">
<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-brown-600 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-success-600 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-danger btn-block padding-3" href="/avexpress/discardproforma/{{ pro.id }}">Descartar</a>#}
<a href="/avexpress/discardproforma/{{ pro.id }}" class="btn bg-danger 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-info-600 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-danger-300 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-danger-300 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">
<span class="input-group-addon bg-teal-800"><i class="icon-floppy-disk"></i></span>
<button type="submit" id="avexpress_save" name="avexpress[save]" class="btn bg-green-600 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 #}
{# --- SERVICIOS PENDIENTES POR APROBAR --- #}
{% if pendingBudgets is not empty %}
<div class="panel">
<div class="panel-body border-blue">
<div class="col-md-12 col-xs-12"><strong class="text-info"><legend class="border-teal-800">Servicios pendientes por aprobar solicitados desde In Out</legend></strong></div>
{% set i = -1 %}
{% for items in pendingBudgets %}
{% set i = i + 1 %}
<form name="AddLotBudgets_{{ keysPendingBudgets[i] }}" method="post" action="/avexpress/budgetadd/" class="form-horizontal" autocomplete="off">
{# ----------------------------- TODOS LOS HIDDEN DEL PROPOSAL ----------------------------- #}
{% for elem in items %}
<input type="hidden" name="backToEditFile" value="{{ id }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
<input type="hidden" id="services_hidden_id_{{ elem.id }}" name="services_hidden[{{ elem.id }}][id]" value="{{ elem.id }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
<input type="hidden" id="services_hidden_controlId_{{ elem.id }}" name="services_hidden[{{ elem.id }}][controlId]" value="{{ elem.controlId }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
<input type="hidden" id="services_hidden_proposalTitle_{{ elem.id }}" name="services_hidden[{{ elem.id }}][proposalTitle]" value="{{ elem.proposalTitle }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
<input type="hidden" id="services_hidden_name_{{ elem.id }}" name="services_hidden[{{ elem.id }}][name]" value="{{ elem.name }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
<input type="hidden" id="services_hidden_price_{{ elem.id }}" name="services_hidden[{{ elem.id }}][price]" value="{{ elem.price }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
<input type="hidden" id="services_hidden_units_{{ elem.id }}" name="services_hidden[{{ elem.id }}][units]" value="{{ elem.units }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
<input type="hidden" id="services_hidden_days_{{ elem.id }}" name="services_hidden[{{ elem.id }}][days]" value="{{ (date(elem.dateOutAt).diff(date(elem.dateInAt))).days }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
{% endfor %}
{# ----------------------------- TODOS LOS HIDDEN DEL PROPOSAL ----------------------------- #}
<div class="col-md-12">
<div class="form-group form-group-material">
<button type="submit" id="add_lot_budgets_submit" name="addlotbudgets[send]" class="btn bg-success-300 btn-block btn-lg">{% trans %}Aprobar el Proposal {% endtrans %} {{ keysPendingBudgets[i] }}</button>
</div>
</div>
</form>
<div class="col-md-1">
</div>
<div class="col-md-3">
<label class="control-label" for="services_currency">{% trans %}Proposal {% endtrans %}</label>
</div>
<div class="col-md-1">
<label class="control-label" for="services_currency">{% trans %}Agente {% endtrans %}</label>
</div>
<div class="col-md-3">
<label class="control-label" for="services_currency">{% trans %}Producto {% endtrans %}</label>
</div>
<div class="col-md-1">
<label class="control-label" for="services_currency">{% trans %}Cantidad {% endtrans %}</label>
</div>
<div class="col-md-1">
<label class="control-label" for="services_currency">{% trans %}No. de Días {% endtrans %}</label>
</div>
<div class="col-md-2">
<label class="control-label" for="services_currency">{% trans %}Precio {% endtrans %}</label>
</div>
{% for pbud in items %}
<form name="AddOneBudgets" method="post" action="/avexpress/budgetadd/" class="form-horizontal" autocomplete="off">
<input type="hidden" name="backToEditFile" value="{{ id }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
<div class="col-md-12">
<div class="col-md-1">
<a href="/avexpress/budgetdel/{{ pbud.id }}"><i class="icon-trash pull-right" style="margin-right: 20px; padding-top: 10px; color: red" title="Eliminar"></i></a>
</div>
<div class="col-md-3">
<div class="form-group form-group-material">
<input type="text" id="product_title_{{ pbud.id }}" name="services_hidden[{{ pbud.id }}][title]" class="form-control input-sombra input-lg" title="{{ pbud.textTooltip }}" placeholder="{% trans %}Title{% endtrans %}*" value="{{ pbud.ProposalId }} - {{ pbud.ProposalTitle }}">
</div>
</div>
<div class="col-md-1">
<div class="form-group form-group-material">
<input type="text" id="product_agent_{{ pbud.id }}" name="services_hidden[{{ pbud.id }}][agent]" class="form-control input-sombra input-lg" placeholder="{% trans %}Agent{% endtrans %}*" value="{{ pbud.userConfirmedFullName }}">
</div>
</div>
<div class="col-md-3">
<div class="form-group form-group-material">
<input type="text" id="product_name_{{ pbud.id }}" name="services_hidden[{{ pbud.id }}][name]" class="form-control input-sombra input-lg" placeholder="{% trans %}Name{% endtrans %}*" value="{{ pbud.name }}">
</div>
</div>
<div class="col-md-1">
<div class="form-group form-group-material">
<input type="number" step="any" id="product_units_{{ pbud.id }}" name="services_hidden[{{ pbud.id }}][units]" onchange="changeBudgetUnits({{ pbud.id }});" class="form-control input-sombra input-lg" placeholder="{% trans %}Units{% endtrans %}*" value="{{ pbud.units }}">
</div>
</div>
<div class="col-md-1">
<div class="form-group form-group-material">
<input type="number" step="any" id="product_days_{{ pbud.id }}" name="services_hidden[{{ pbud.id }}][days]" onchange="changeBudgetDays({{ pbud.id }});" class="form-control input-sombra input-lg" placeholder="{% trans %}Days{% endtrans %}*" value="{{ (date(pbud.dateOutAt).diff(date(pbud.dateInAt))).days }}">
</div>
</div>
<div class="col-md-1">
<div class="form-group form-group-material">
<input type="number" step="any" id="product_price_{{ pbud.id }}" name="services_hidden[{{ pbud.id }}][price]" onchange="changeBudgetPrice({{ pbud.id }});" class="form-control input-sombra input-lg" placeholder="{% trans %}Price{% endtrans %}*" value="{{ pbud.price }}">
</div>
</div>
<input type="hidden" id="product_id_{{ pbud.id }}" name="services_hidden[{{ pbud.id }}][id]" value="{{ pbud.id }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
<input type="hidden" id="product_control_id_{{ pbud.id }}" name="services_hidden[{{ pbud.id }}][controlId]" value="{{ pbud.controlId }}" class="form-control bg-slate-400" style="padding:0px; min-width:25px; height: 22px;"/>
<div class="col-md-1">
<div class="form-group form-group-material">
<button type="submit" id="invoice_deposit_sumit" name="invoicedep[send]" class="btn bg-success btn-block btn-lg">{% trans %}Aprobar{% endtrans %}</button>
</div>
</div>
</div>
</form>
{% endfor %}
{% endfor %}
</div>
</div>
{% endif %}
{# --- SERVICIOS PENDIENTES POR APROBAR --- #}
{% if numeroItems > 0 %}
<div class="col-sm-12">
<div class="panel">
<div class="panel-body">
<div class="col-md-12 col-xs-12" ><strong class="text-info">
<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-danger-800 btn-block padding-3" href="/avexpress/cleanproductfile/{{ id }}">Limpiar el expediente</a>#}
<a href="/avexpress/cleanproductfile/{{ id }}" class="btn bg-danger-800 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-info-600 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-danger-300 btn-block icon-trash padding-3" href="/avexpress/productfiledelete/{{ item.id }}" title="Eliminar este elemento"></a>
{% else %}
<a target="_self" class="btn bg-danger-300 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">
<span class="input-group-addon bg-teal-800"><i class="icon-floppy-disk"></i></span>
<button type="submit" id="avexpress_save" name="avexpress[save]" class="btn bg-green-600 btn-block">Guardar Expediente</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>
{% endif %}
<div class="col-sm-12">
<div class="panel">
<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-success">{% 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-success">{% trans %}IVA{% endtrans %} (Productos)</b><br><b> {{ totales_global_iva|number_format(2, '.', ',') }} €</b></div>
<div class="col-sm-2"><b class="text-success">{% 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-success">{% trans %}Beneficio €{% endtrans %} </b><br><b> {{ benefitEuro|number_format(2, '.', ',') }} €</b></div>
<div class="col-sm-2"><b class="text-success">{% 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">
<div class="panel-body">
<div class="col-sm-12 ">
<div class="col-md-12 col-xs-12" ><strong class="text-info text-left">
<legend class="border-teal-800">{% trans %}Observaciones y Comentarios 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">
<div class="form-group form-group-material">
<div class="input-group teal">
<span class="input-group-addon bg-teal-800"><i class="icon-floppy-disk"></i></span>
<button type="submit" id="avexpress_comments_save" name="avexpress_comments[save]" class="btn bg-green-600 btn-block">Guardar Observaciones</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>
{% endif %}
{# --- GENERADOR DE PLANTILLA --- #}
{% if numeroItems > 0 %}
<div class="col-sm-12">
<div class="panel">
<div class="panel-body text-center">
<div class="col-sm-12 ">
<div class="col-md-12 col-xs-12" ><strong class="text-info 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 }}">
<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">
<span class="input-group-addon bg-teal-800"><i class="icon-floppy-disk"></i></span>
<button type="submit" id="avexpress_save" name="avexpress[save]" class="btn bg-green-600 btn-block">Guardar como Plantilla</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endif %}
{#<div class="col-sm-12">#}
{#<div class="panel">#}
{#<div class="panel-body text-center">#}
{#<div class="col-sm-12 ">#}
{#<div class="col-sm-12 no-padding">#}
{#<div class="panel">#}
{#<div class="panel-heading bg-info">#}
{#<h6 class="panel-title">{% trans %}Agregar Servicios al Expediente{% endtrans %}<a class="heading-elements-toggle"><i class="icon-more"></i></a></h6>#}
{#</div>#}
{#<div class="panel-body">#}
{#<div class="col-sm-12 no-padding">#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-teal btn-block btn-float btn-float-lg" title="{% trans %}Accommodation{% endtrans %}" href="/avexpress/white/services/add/1/{{ id }}"><i class="icon-home7"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-purple btn-block btn-float btn-float-lg" title="{% trans %}Menu{% endtrans %}" href="/avexpress/white/services/add/11/{{ id }}"><i class="icon-book"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-warning btn-block btn-float btn-float-lg" title="{% trans %}Lounge{% endtrans %}" href="/avexpress/white/services/add/10/{{ id }}"><i class="icon-cup2"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-blue btn-block btn-float btn-float-lg" title="{% trans %}Activities{% endtrans %}" href="/avexpress/white/services/add/2/{{ id }}"><i class="icon-theater"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-indigo btn-block btn-float btn-float-lg" title="{% trans %}Itinerariese{% endtrans %}" href="/avexpress/white/services/add/9/{{ id }}"><i class="icon-direction"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-brown btn-block btn-float btn-float-lg" title="{% trans %}Cruise{% endtrans %}" href="/avexpress/white/services/add/5/{{ id }}"><i class="icon-ship"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-grey btn-block btn-float btn-float-lg" title="{% trans %}Transport{% endtrans %}" href="/avexpress/white/services/add/13/{{ id }}"><i class="icon-chopper"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-slate btn-block btn-float btn-float-lg" title="{% trans %}AV{% endtrans %}" href="/avexpress/white/services/add/3/{{ id }}"><i class="icon-presentation"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-orange btn-block btn-float btn-float-lg" title="{% trans %}Creative{% endtrans %}" href="/avexpress/white/services/add/4/{{ id }}"><i class="icon-droplet"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-pink btn-block btn-float btn-float-lg" title="{% trans %}Gifts{% endtrans %}" href="/avexpress/white/services/add/7/{{ id }}"><i class="icon-gift"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-green btn-block btn-float btn-float-lg" title="{% trans %}Entertainment{% endtrans %}" href="/avexpress/white/services/add/6/{{ id }}"><i class=" icon-glasses-3d2"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-orange btn-block btn-float btn-float-lg" title="{% trans %}Guides{% endtrans %}" href="/avexpress/white/services/add/8/{{ id }}"><i class="icon-map"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-slate-800 btn-block btn-float btn-float-lg" title="{% trans %}Technology{% endtrans %}" href="/avexpress/white/services/add/14/{{ id }}"><i class="icon-cloud-upload"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-indigo-800 btn-block btn-float btn-float-lg" title="{% trans %}Assistant{% endtrans %}" href="/avexpress/white/services/add/15/{{ id }}"><i class="icon-person"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-danger btn-block btn-float btn-float-lg" title="{% trans %}Others{% endtrans %}" href="/avexpress/white/services/add/12/{{ id }}"><i class="icon-clipboard3"></i></a>#}
{#</div>#}
{#<div class="col-xs-1 margen-10">#}
{#<a type="button" class="btn bg-green-300 btn-block btn-float btn-float-lg" title="{% trans %}DDR{% endtrans %}" href="/avexpress/white/services/add/16/{{ id }}"><i class="icon-list"></i></a>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#{% if services is not empty %}#}
{#<form name="ave_avexpressbundle_servicegrid" method="post" action="/avexpress/updateservicegrid/{{ id }}" class="form-horizontal" role="form" autocomplete="off">#}
{#<div class="col-sm-12 margen-15" style="padding-left: 0px; padding-right: 0px">#}
{#<div class="panel">#}
{#<div class="panel-body">#}
{#<div class="col-md-12 col-xs-12" ><strong class="text-info text-left">#}
{#<legend class="border-teal-800">{% trans %}Services{% endtrans %}</legend></strong>#}
{#</div>#}
{#</div>#}
{#{% for service in services %}#}
{#{% set loopIndex = loop.index %}#}
{#{% if service.currency is empty %}#}
{#{% set currency = 'Euro' %}#}
{#{% else %}#}
{#{% set currency = service.currency %}#}
{#{% endif %}#}
{#{% set contcolor = service.contcolor %}#}
{#{% set error_commission = '' %}#}
{#{% if service.commission is empty or service.commission =='0' %}#}
{#{% set error_commission = 'has-error' %}#}
{#{% endif %}#}
{#{% set error_over = '' %}#}
{#{% if service.over is empty or service.over =='0' %}#}
{#{% set error_over = 'has-error' %}#}
{#{% endif %}#}
{#{% set error_iva = '' %}#}
{#{% if service.iva is empty or service.iva =='0' %}#}
{#{% set error_iva = 'has-error' %}#}
{#{% endif %}#}
{#{% if service.opCommission is empty %}#}
{#{% set option_opcommission = '<option value="1" selected="selected">+</option><option value="0">-</option>' %}#}
{#{% else %}#}
{#{% if service.opCommission == '0' %}#}
{#{% set option_opcommission = '<option value="0" selected="selected">-</option><option value="1">+</option>' %}#}
{#{% elseif service.opCommission == '1' %}#}
{#{% set option_opcommission = '<option value="1" selected="selected">+</option><option value="0">-</option>' %}#}
{#{% endif %}#}
{#{% endif %}#}
{#{% if service.opOver is empty %}#}
{#{% set option_opover = '<option value="1" selected="selected">+</option><option value="0">-</option>' %}#}
{#{% else %}#}
{#{% if service.opOver == '0' %}#}
{#{% set option_opover = '<option value="0" selected="selected">-</option><option value="1">+</option>' %}#}
{#{% elseif service.opOver == '1' %}#}
{#{% set option_opover = '<option value="1" selected="selected">+</option><option value="0">-</option>' %}#}
{#{% endif %}#}
{#{% endif %}#}
{#{% if service.opIva is empty %}#}
{#{% set option_opiva = '<option value="1" selected="selected">+</option><option value="0">-</option>' %}#}
{#{% else %}#}
{#{% if service.opIva == '0' %}#}
{#{% set option_opiva = '<option value="0" selected="selected">-</option><option value="1">+</option>' %}#}
{#{% elseif service.opIva == '1' %}#}
{#{% set option_opiva = '<option value="1" selected="selected">+</option><option value="0">-</option>' %}#}
{#{% endif %}#}
{#{% endif %}#}
{#{% set fondo_color = 'white' %}#}
{#{% if service.serviceId == '0' and service.serviceCatId != "16"%}#}
{#{% set message_presentation = 'This service has no presentation because it has not been added to the supplier as a service'|trans %}#}
{#{% set name_presentation = 'Service without presentation'|trans %}#}
{#{% set boton_presentation = 'Save Service in Supplier'|trans %}#}
{#{% set no_presentacion_tip = '<span data-popup="tooltip-custom" title="' ~ message_presentation ~'"><span class="label text-danger-800"><b>' ~ name_presentation ~':</b></span></span>' %}#}
{#{% set no_presentacion = '#}
{#<div class="panel-footer">#}
{#<span class="label text-danger-800"><b>' ~ name_presentation ~':</b></span>#}
{#<span class="label text-grey-800"><i class"text-grey">' ~ message_presentation ~'.</i> |</span>#}
{#<a class="text-teal boton_services_supplier_proposal" href="/supplier/services/fromproposal/' ~ service.serviceCatName|lower ~ '/add/' ~ service.id ~ '">' ~ boton_presentation ~ '</a></i>#}
{#</div>' %}#}
{#{% else %}#}
{#{% set message_presentation = '' %}#}
{#{% set name_presentation = '' %}#}
{#{% set no_presentacion_tip = '' %}#}
{#{% set no_presentacion = '' %}#}
{#{% endif %}#}
{#{% if service.serviceCatId =="1" %}#}
{#{% set name_days_night = "Nights" %}#}
{#{% else %}#}
{#{% set name_days_night = "Days" %}#}
{#{% endif %}#}
{#{% if service.serviceCatId =="1" %}#}
{#{% set name_days_night = "Nights" %}#}
{#{% else %}#}
{#{% set name_days_night = "Days" %}#}
{#{% endif %}#}
{#{% set additional = '' %}#}
{#<div id="{{ service.id }}" class="panel panel-flat border-left-lg border-left-{{ contcolor }} {{ fondo_color }} panel-collapsed">#}
{#<div class="panel-heading">#}
{#<div class="panel-title text-left">#}
{#<b class="text-{{ contcolor }}">{% trans %}Service{% endtrans %}: {{ service.serviceCatName|trans }} {% if (service.name is not null) %} - {{ service.name }}{% endif %}</b>#}
{#{% autoescape %}{{ additional|raw }}{% endautoescape %}#}
{#</div>#}
{#<div class="heading-elements">#}
{#<ul class="icons-list">#}
{#<li><a data-action="collapse"></a></li>#}
{#</ul>#}
{#</div>#}
{#</div>#}
{#<div class="panel-body">#}
{#<div class="form-group">#}
{#<div class="col-sm-11">#}
{#<div class="col-sm-12">#}
{#<div class="col-sm-2" style="padding-bottom: 10px; padding-left: 0px; ">#}
{#<label class="control-label" for="services_opcommission">{% trans %}Supplier{% endtrans %}:</label>#}
{#<div class="form-group form-group-material">#}
{#<select id="services_supplier_{{ service.id }}" name="services[{{ service.id }}][supplier]" class="form-control" style="padding:0px;text-align-last: center;">#}
{#<option value="0">{% trans %}Select a Supplier{% endtrans %}</option>#}
{#{% for supplier in listSupplier %}#}
{#{% if supplier.id == service.supplierId %}#}
{#<option value="{{ supplier.id }}" selected="selected">{{ supplier.company }}</option>#}
{#{% else %}#}
{#<option value="{{ supplier.id }}">{{ supplier.company }}</option>#}
{#{% endif %}#}
{#{% endfor %}#}
{#</select>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#<div class="col-sm-2">#}
{#<label class="control-label" for="services_name">{% trans %}Name{% endtrans %}: </label>#}
{#<input type="text" id="services_name_{{ service.id }}" name="services[{{ service.id }}][name]" value="{{ service.name }}" class="form-control">#}
{#</div>#}
{#<div class="col-md-2 col-xs-12">#}
{#<label class="control-label" for="services_price">#}
{#<span data-popup="tooltip-custom" title="{% trans %}Price with VAT or without VAT{% endtrans %}">#}
{#<b class="text-{{ contcolor }}">{% trans %}Price{% endtrans %}</b>:#}
{#</span>#}
{#</label>#}
{#<input type="text" id="services_price_{{ service.id }}" name="services[{{ service.id }}][price]" value="{{ service.price }}" class="form-control bg-{{ contcolor }}-300">#}
{#</div>#}
{#<div class="col-md-1 col-xs-6">#}
{#<label class="control-label" for="services_currency">{% trans %}Currency{% endtrans %}: </label>#}
{#<input type="text" id="services_currency_{{ service.id }}" name="services[{{ service.id }}][currency]" value="{{ currency }}" class="form-control">#}
{#</div>#}
{#<div class="col-md-1 col-xs-6">#}
{#<label class="control-label" for="services_units">{% trans %}Units{% endtrans %}: </label>#}
{#<input type="number" id="services_units_{{ service.id }}" name="services[{{ service.id }}][units]" value="{{ service.units }}" class="form-control">#}
{#</div>#}
{#<div class="col-md-1 col-xs-12">#}
{#<label class="control-label" for="services_pax">{% trans %}Pax{% endtrans %}: </label>#}
{#<input type="number" id="services_pax_{{ service.id }}" name="services[{{ service.id }}][pax]" value="{{ service.pax }}" class="form-control">#}
{#</div>#}
{#<div class="col-md-5 col-xs-12">#}
{#{% autoescape %}#}
{#<div class="col-md-2 col-xs-6 no-padding-right">#}
{#<label class="control-label" for="services_opcommission" >-/+: </label>#}
{#<div class="form-group form-group-material">#}
{#<select id="services_opcommission_{{ service.id }}" name="services[{{ service.id }}][opCommission]" class="form-control" style="padding:0px;text-align-last: center;">#}
{#{{ option_opcommission|raw }}#}
{#</select>#}
{#</div>#}
{#</div>#}
{#<div class="col-md-2 col-xs-6 no-padding-left">#}
{#<label class="control-label" for="services_commission">{% trans %}Commission{% endtrans %}: </label>#}
{#<div class="form-group form-group-material {{ error_commission }}">#}
{#<input type="text" id="services_commission_{{ service.id }}" name="services[{{ service.id }}][commission]" value="{{ service.commission }}" class="form-control">#}
{#</div>#}
{#</div>#}
{#<div class="col-md-2 col-xs-6 no-padding-right">#}
{#<label class="control-label" for="services_opover">-/+: </label>#}
{#<div class="form-group form-group-material">#}
{#<select id="services_opover_{{ service.id }}" name="services[{{ service.id }}][opOver]" class="form-control" style="padding:0px;text-align-last: center;">#}
{#{{ option_opover|raw }}#}
{#</select>#}
{#</div>#}
{#</div>#}
{#<div class="col-md-2 col-xs-6 no-padding-left">#}
{#<label class="control-label" for="services_over">{% trans %}Over{% endtrans %}: </label>#}
{#<div class="form-group form-group-material {{ error_over }}">#}
{#<input type="text" id="services_over_{{ service.id }}" name="services[{{ service.id }}][over]" value="{{ service.over }}" class="form-control">#}
{#</div>#}
{#</div>#}
{#<div class="col-md-2 col-xs-6 no-padding-right">#}
{#<label class="control-label" for="services_opiva">-/+: </label>#}
{#<div class="form-group form-group-material">#}
{#<select id="services_opiva_{{ service.id }}" name="services[{{ service.id }}][opIva]" class="form-control" style="padding:0px;text-align-last: center;">#}
{#{{ option_opiva|raw }}#}
{#</select>#}
{#</div>#}
{#</div>#}
{#{% if service.iva is not empty %}#}
{#{% set ivaService = service.iva %}#}
{#{% else %}#}
{#{% set ivaService = 0 %}#}
{#{% endif %}#}
{#<div class="col-md-2 col-xs-6 no-padding-left">#}
{#<label class="control-label" for="services_iva">{% trans %}Iva{% endtrans %}: </label>#}
{#<div class="form-group form-group-material {{ error_iva }}">#}
{#<input type="text" id="services_iva_{{ service.id }}" name="services[{{ service.id }}][iva]" value="{{ ivaService }}" class="form-control">#}
{#</div>#}
{#</div>#}
{#{% endautoescape %}#}
{#</div>#}
{#<div class="col-sm-8 margen-10">#}
{#<div class="col-sm-2 no-padding">#}
{#<label class="control-label" for="services_hour"><i class="icon-watch2"></i> {% trans %}Star{% endtrans %}: </label>#}
{#<input type="time" id="services_start_{{ service.id }}" name="services[{{ service.id }}][start]" value="{{ service.dateInAt|date('H:i') }}" class="form-control">#}
{#</div>#}
{#<div class="col-sm-4">#}
{#<label class="control-label" for="services_dateInAt">{% trans %}Date In{% endtrans %}: </label>#}
{#<input type="date" id="services_dateInAt_{{ service.id }}" name="services[{{ service.id }}][dateInAt]" value="{{ service.dateInAt|date('Y-m-d') }}" class="form-control">#}
{#</div>#}
{#<div class="col-sm-4">#}
{#<label class="control-label" for="services_dateOutAt">{% trans %}Date Out{% endtrans %}: </label>#}
{#<input type="date" id="services_dateOutAt_{{ service.id }}" name="services[{{ service.id }}][dateOutAt]" value="{{ service.dateOutAt|date('Y-m-d') }}" class="form-control">#}
{#</div>#}
{#<div class="col-sm-2 no-padding">#}
{#<label class="control-label" for="services_hour"><i class="icon-watch2"></i> {% trans %}End{% endtrans %}: </label>#}
{#<input type="time" id="services_hour_{{ service.id }}" name="services[{{ service.id }}][end]" value="{{ service.dateOutAt|date('H:i') }}" class="form-control">#}
{#</div>#}
{#</div>#}
{#</div>#}
{#<div class="col-sm-1 margen-5">#}
{#<div class="col-md-12 col-xs-12">#}
{#</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 text-center" title="Eliminar este item">#}
{#<input type="checkbox" class="switchery-info boolDelete" id="services_delete_{{ service.id }}" name="services_{{ service.id }}[boolDelete]" value="1">#}
{#<a target="_self" class="btn bg-danger-300 btn-block icon-trash padding-3" href="/avexpress/deleteitemservice/{{ service.id }}/{{ id }}" title="Eliminar este elemento"></a>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#{% endfor %}#}
{#</div>#}
{#</div>#}
{#<div class="col-md-12 margen-20" style="padding-top: 5px; padding-left: 15px;padding-right: 15px">#}
{#<div class="form-group form-group-material">#}
{#<div class="input-group teal">#}
{#<span class="input-group-addon bg-teal-800"><i class="icon-floppy-disk"></i></span>#}
{#<button type="submit" id="ave_avexpressbundle_servicegrid_save" name="ave_avexpressbundle_servicegrid[save]" class="btn bg-green-600 btn-block">Guardar Servicios</button>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#</form>#}
{#{% endif %}#}
{#</div>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#<div class="col-sm-12">#}
{#<div class="panel">#}
{#<div class="panel-body text-center">#}
{#<div class="col-sm-12 ">#}
{#<div class="col-sm-4"><b class="text-success">{% trans %}Sale Client Global{% endtrans %} (Servicios)</b><br><b> {{ totales_global_servicios_con_iva|number_format(2, '.', ',') }} €</b></div>#}
{#<div class="col-sm-4"><b class="text-success">{% trans %}IVA{% endtrans %} (Servicios)</b><br><b> {{ totales_global_servicios_iva|number_format(2, '.', ',') }} €</b></div>#}
{#<div class="col-sm-4"><b class="text-success">{% trans %}Sale No Vat{% endtrans %} (Servicios)</b><br><b> {{ totales_global_servicios_neto|number_format(2, '.', ',') }} €</b></div>#}
{#</div>#}
{#</div>#}
{#</div>#}
{#</div>#}
<div class="col-sm-12">
<div class="panel">
<div class="panel-body">
<div class="col-md-12 col-xs-12" ><strong class="text-info">
<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 btn-success btn-xs" href="/avexpress/viewinvoice/{{ factura.id }}">{% trans %}Go{% endtrans %}</a>
{% else %}
{% if factura.type == 'Factura de Deposito' %}
{#Factura de deposito#}
<a class="btn btn-success btn-xs" href="/avexpress/viewinvoicedeposit/{{ factura.id }}">{% trans %}Go{% endtrans %}</a>
{% else %}
{% if factura.type == 'Invoice Rec' %}
{#Factura rectificativa#}
<a class="btn btn-success 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 btn-success 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>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 text-center">
<div class="panel bg-danger-300" style="padding-top: 10px; padding-bottom: 0px; bottom: 0; position: fixed; width: 80%">
<div class="col-sm-4"><b>{% trans %}Sale Client Global{% endtrans %}</b><br><b> {{ sumatoria_totales_global_con_iva|number_format(2, '.', ',') }} € </b></div>
<div class="col-sm-4"><b>{% trans %}IVA{% endtrans %}</b><br><b> {{ sumatoria_totales_global_iva|number_format(2, '.', ',') }} €</b></div>
<div class="col-sm-4"><b>{% trans %}Sale No Vat{% endtrans %}</b><br><b> {{ sumatoria_totales_global_neto|number_format(2, '.', ',') }} €</b></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 %}