{% block stylesheets %} {% endblock %}
{% if sale.shop.avoidPrintLogoOnTicket == 0 %}

{% endif %}
{% if sale.shop.nameCommercialForTickets != "" %} {{ sale.shop.nameCommercialForTickets | upper }} {% else %} {{ sale.group.name | upper }} {% endif %}
{{ sale.shop.company.name | upper }}
NIF: {{ sale.shop.company.cif | upper }}
{% if sale.shop.avoidPrintAddressOnTicket == 0 %} {{ sale.shop.company.address | upper }}
{{ sale.shop.company.zip }} {{ sale.shop.company.city | upper }}
{% endif %}
{{ sale.shop.address | upper }}
{{ sale.shop.city | upper }}
TFNO: {{ sale.shop.telephone | upper }}
FACTURA SIMPLIFICADA
Factura simplificada: {{ sale.invoiceNumberAuto }}

Nº Venta: {{ sale.alias }}
{% if sale.invoiceNumber %}
Factura nominativa: {{ sale.invoiceNumber }}
{% endif %} {% if sale.invoiceNumberRectifier %}
Factura rectificativa: {{ sale.invoiceNumberRectifier }}
{% endif %}
VENDEDOR: {{ sale.user.name | upper }}
FECHA: {{ sale.completionDate | date('d/m/Y') }} {{ sale.completionDate | date('H:i') }} HORAS
{% set toalSaleSumHere = 0 %} {% set toalDiscountSumHere = 0 %} {% for article in elementsIntoSale %} {% set stockPVP = article.stock.pvp %} {% set stockPVPFinal = article.stock.pvpFinal %} {% set stockPVPFinalForSale = article.stock.pvpFinalForSale %} {% set discountManual = (article.stock.pvpFinal - article.stock.pvpFinalForSale) %} {% set discountCampaing = (article.stock.pvp - article.stock.pvpFinalForSale) %} {% set discountPercentage = render(controller('CoreBundle:SalesPoint:getPercentage', {'stockId' : article.stock.id })) %} {% set discountPercentageCamapaing = render(controller('CoreBundle:SalesPoint:getPercentageCampaing', {'stock' : article.stock })) %} {% if discountManual != 0 or discountCampaing != 0 %} {% if article.typeSaleElementStatus.id == constant('CoreBundle\\Entity\\TypeSaleElementStatus::ID_STATUS_SELL') %} {% if sale.group.groupConfiguration.showDiscountsDetailSaleTicket == false %} {% if stockPVPFinal != stockPVPFinalForSale %} {% endif %} {% else %} {% endif %} {% endif %} {% endif %} {% endfor %} {% set discountBase = render(controller('CoreBundle:SalesPoint:getDiscountBase', { 'saleId' : sale.id })) %} {% if sale.group.groupConfiguration.showDiscountsDetailSaleTicket == false %} {% if sale.getPathAmount is null%} {% endif %} {% else %} {% endif %} {% for bag in sale.bagOnSale %} {% endfor %} {% if sale.group.groupConfiguration.showDiscountsDetailSaleTicket == false %} {% if sale.totalDiscount + sale.roundAmount != 0 %} {% if discountBase > 0 %} {% else %} {% endif %} {% endif %} {% else %} {% if toalDiscountSumHere != 0 %} {% endif %} {% endif %}
ARTICULO TALLA UDS. IMPORTE
{% if sale.shop.ticketItem == "model" or sale.shop.ticketItem == "" %} {{ article.stock.article.articleModel | upper | truncate(10, false, '...') }} {% endif %} {% if sale.shop.ticketItem == "reference" %} {{ article.stock.article.ref }} {% endif %} {% if sale.shop.ticketItem == "label" %} {{ article.stock.article.descriptionLabel }} {% endif %} {{ article.stock.typeSize.description }} 1 {% if article.typeSaleElementStatus.id == constant('CoreBundle\\Entity\\TypeSaleElementStatus::ID_STATUS_RETURNED') %} {% if article.pvpFinal is not null %} - {{ article.pvpFinal | number_format(2, ',', '.') }}€ {% else %} - {{ article.stock.pvpFinalForSale | number_format(2, ',', '.') }}€ {% endif %} {% else %} {% if sale.group.groupConfiguration.showDiscountsDetailSaleTicket == false %} {{ article.stock.pvpFinalForSale | number_format(2, ',', '.') }}€ {% else %} {% if discountManual != 0 or discountCampaing != 0 %} {{ article.stock.pvp | number_format(2, ',', '.') }}€ {% set toalSaleSumHere = toalSaleSumHere + article.stock.pvp %} {% else %} {{ article.stock.pvpFinalForSale | number_format(2, ',', '.') }}€ {% set toalSaleSumHere = toalSaleSumHere + article.stock.pvpFinalForSale %} {% endif %} {% endif %} {% endif %}
Dto: {{ discountPercentage | number_format(2, ',', '.') }}% {{ discountManual | number_format(2, ',', '.') }}€
{% if discountPercentageCamapaing > 0 %} {{ stockPVPFinalForSale | number_format(2, ',', '.') }}€ {% endif %} {% if discountPercentage > 0 %} {% if discountPercentage > 0 %}
{% endif %} {{ article.stock.pvpFinal | number_format(2, ',', '.') }}€ {% endif %}
{% if discountPercentageCamapaing > 0 %} Rebajas: {{ discountPercentageCamapaing | number_format(2, ',', '.') }}% {% endif %} {% if discountPercentage > 0 %} {% if discountPercentageCamapaing > 0 %}
{% endif %} Dto: {{ discountPercentage | number_format(2, ',', '.') }}% {% endif %}
{% if discountCampaing > 0 %} -{{ discountCampaing | number_format(2, ',', '.') }}€ {% set toalDiscountSumHere = toalDiscountSumHere + discountCampaing %} {% endif %} {% if discountManual != 0 %} {% if discountManual != 0 %}
{% endif %} {{ discountManual | number_format(2, ',', '.') }}€ {% set toalDiscountSumHere = toalDiscountSumHere + (discountManual * -1) %} {% endif %}
TOTAL {{ ( render(controller('CoreBundle:SalesPoint:getTotalBase', { 'saleId' : sale.id })) - discountBase) | number_format(2, ',', '.') }}€
TOTAL {{ toalSaleSumHere | number_format(2, ',', '.') }}€
Bolsa {{ bag.amount | number_format(2, ',', '.') }}€
DTO TOTAL -{{ discountBase | number_format(2, ',', '.') }}€{{ (discountBase * -1) | number_format(2, ',', '.') }}€
DTO TOTAL -{{ toalDiscountSumHere | number_format(2, ',', '.') }}€

TOTAL COMPRA
{{ sale.totalFinal | number_format(2, ',', '.') }}€

{% if sale.coupon %}
Cupón: {{ sale.coupon.name }}
{% endif %} {% if sale.fidelityCard %}
Tarjeta de fidelización: {{ sale.fidelityCard.description }} (-{{ sale.fidelityCard.amount }}%)
{% endif %} {% if sale.amountPiggyBank != 0 %}
Hucha ahorro descontada en esta venta: {{ sale.amountPiggyBank | number_format(2, ',', '.') }}€
{% endif %} {% if sale.customer %} {% if sale.customer.amountPiggyBank != 0 %}
Acumulado hucha ahorro: {{ sale.customer.amountPiggyBank | number_format(2, ',', '.') }}€
{% endif %} {% endif %}
{% for salePayment in sale.salePayment %} {% if salePayment.typeSsalePaymentWhoPay.id == constant('CoreBundle\\Entity\\TypeSalePaymentWhoPay::ID_CLIENT_PAY') %} CLIENTE ABONA: {% elseif salePayment.typeSsalePaymentWhoPay.id == constant('CoreBundle\\Entity\\TypeSalePaymentWhoPay::ID_COMPANY_PAY') %} DEPENDIENTE DEVUELVE: - {% endif %} {{ salePayment.ammount | number_format(2, ',', '.') }} € {{ salePayment.typeSsalePayment.description }} {% if salePayment.id in extraPaymentData|keys %} {{ extraPaymentData[salePayment.id].title }} {% endif %}
{% endfor %}
Nº TOTAL DE ARTICULOS: {{ sale.saleElement | length }}
IMPUESTOS INCLUIDOS
DESGLOSE TIPO DE IMPUESTO
{% for tax in taxesTicket %} IMPUESTO: {{ tax["name"] }} ({{ tax["percentage"] }}%) CUOTA: {{ tax["quota"] | number_format(2, ',', '.') }}€ - BASE: {{ tax["amount"] | number_format(2, ',', '.') }}€
{% endfor %}
{% if ticketBAI_QR != "" %}
{{ identificadorTBAI }}
{% endif %} {% if rawTicketSaimapay != "" %}
{{ rawTicketSaimapay | raw }}
{% endif %} {% if sale.shop.getWebTicketFooter() %}

{% endif %} {% if sale.shop.textForTicket != "" %}
GRACIAS POR SU VISITA
{{ sale.shop.textForTicket | upper }}
{% endif %}
{% if rawTicketSaimapayForShop != "" %}
{{ rawTicketSaimapayForShop | raw }}
{% endif %}