{% extends 'AppBundle:Documents:v2\\standard_layout.html.twig' %} {% import 'AppBundle:Documents:v2\\Import\\invoice.html.twig' as invoiceF %} {% set beforValueDiscount = beforValueDiscount is defined ? beforValueDiscount : '- ' %} {% block header %} {% set editor = '' %} {% if seller is not null %} {% set editor = {'label': 'user.seller.title'|trans({}, 'DocumentTrans'), 'contactLabel': 'contact.title'|trans({}, 'DocumentTrans' )}|merge(seller) %} {% endif %} {% set editor = editor %} {% include 'AppBundle:Documents:v2\\Include\\Global\\header.html.twig' with {'editor': editor} %} {% endblock header %} {% block main_title %} {% embed 'AppBundle:Documents:v2\\Include\\Administrative\\customer.html.twig' with { 'loaner' : sellingData.loaner, 'customer' : sellingData.customer, 'coCustomer' : sellingData.coCustomer, 'isSpouse' : sellingData.isSpouse, 'countries': countries } %} {% block tvaIntracom %} {% if customer.tvaIntracom is not empty %} {{ 'group.vat'|trans({}, 'DocumentTrans') }} : {{ customer.tvaIntracom }} {% endif %} {% endblock tvaIntracom %} {% block infoAdditionalCustomer %} {% if customer.cellPhoneNumber is not empty %} {{ 'cellphone_number'|trans({}, 'DocumentTrans' )}} : {{ customer.cellPhoneNumber }}
{% endif %} {% if customer.phoneNumber is not empty %} {{ 'phone_number'|trans({}, 'DocumentTrans' )}} : {{ customer.phoneNumber }}
{% endif %} {% if customer.email is not empty %} {{ 'email'|trans({}, 'DocumentTrans' )}} : {{ customer.email }} {% endif %} {% endblock infoAdditionalCustomer %} {% endembed %}

{{ invoiceF.getTitle(object, {'documentType': documentType}) }}

{{ 'the'|trans({}, 'DocumentTrans' ) ~ " " ~ invoiceDate|date("d/m/Y") }} | {{ invoiceF.getSubTitle(object, {}) }}

{{ 'contact.customer.account'|trans({}, 'DocumentTrans' ) }} : {{ customerAccount }}
{% endblock main_title %} {% block content %} {% set isDiscount = true %} {% if sellingData.prices.priceDiscount|number_format == 0 %} {% set isDiscount = false %} {% endif %} {% set warranty = null %} {% if vehicleData.distanceTraveled is not empty %} {% if vehicleData.distanceTraveledWarranty is not empty and vehicleData.distanceTraveledWarranty == true %} {% set warranty = 'vehicle.warranty.yes'|trans({}, 'DocumentTrans' ) %} {% else %} {% set warranty = 'vehicle.warranty.no'|trans({}, 'DocumentTrans' ) %} {% endif %} {% endif %} {% set warrantyLabel = null %} {% if vehicleData.warrantyType == 'vehicle.warranty.type.with' %} {% set warrantyLabel = vehicleData.warrantyLabel %} {% elseif vehicleData.warrantyType == 'vehicle.warranty.type.manufacturer' %} {% set warrantyLabel = 'vehicle.warranty.type.manufacturer'|trans({}, 'DocumentTrans' ) %} {% elseif vehicleData.warrantyType == 'vehicle.warranty.type.without' %} {% set warrantyLabel = 'vehicle.warranty.type.without'|trans({}, 'DocumentTrans' ) %} {{ 'vehicle.warranty.type.without'|trans({}, 'DocumentTrans' )}} {% endif %} {% set isDisplayHeaderInfo = false %} {% if object.type == constant('AppBundle\\Entity\\Administrative\\Invoice\\InvoiceBase::INVOICE_TYPE_REPAIR_ORDER') and sellingData.serviceSellings is not empty %} {% set isDisplayHeaderInfo = true %} {% endif %} {% set headerInfo = [ { 'label': 'vehicle.internal_reference_short', 'class': object.type == constant('AppBundle\\Entity\\Administrative\\Invoice\\InvoiceBase::INVOICE_TYPE_REPAIR_ORDER') and sellingData.serviceSellings is empty ? 'w-20' : 'w-6', 'display': true }, { 'label': 'service.name', 'class': '', 'display': true }, ] %} {% set contentInfo = [ {'value': vehicleData.voVnType}, {'value': [ { 'label': 'vehicle.vo', 'content': vehicleData.vo }, { 'label': 'vehicle.brand', 'content': vehicleData.brand }, { 'label': 'vehicle.model', 'content': vehicleData.model }, { 'label': 'vehicle.version', 'content': vehicleData.version }, { 'label': 'vehicle.date_of_distribution', 'content': vehicleData.dateOfDistribution is not null ? vehicleData.dateOfDistribution|date('d/m/Y') : null }, { 'label': 'vehicle.serial_number', 'content': vehicleData.vin }, { 'label': 'vehicle.license_number_complete', 'content': vehicleData.licenseNumber }, { 'label': 'vehicle.mileage_complete', 'content': vehicleData.distanceTraveled is not null ? vehicleData.distanceTraveled ~ ' Km ' ~ warranty : null }, { 'label': 'vehicle.energy', 'content': vehicleData.energy }, { 'label': 'vehicle.tax_horsepower', 'content': vehicleData.taxHorsepower is not null ? vehicleData.taxHorsepower ~ ' CV' : null }, { 'label': 'vehicle.horsepower', 'content': vehicleData.horsepower is not null ? vehicleData.horsepower ~ ' Ch' : null }, { 'label': 'vehicle.co2', 'content': vehicleData.extraUrbanKmConsumption is not null ? vehicleData.extraUrbanKmConsumption ~ ' g/km' : null }, { 'label': 'vehicle.color', 'content': vehicleData.color }, { 'label': 'vehicle.warranty.type.title', 'content': warrantyLabel }, { 'label': 'vehicle.warranty.organization.title', 'content': vehicleData.warrantyOrganization }, { 'label': 'vehicle.warranty.duration.title', 'content': vehicleData.warrantyDuration is not null ? vehicleData.warrantyDuration ~ ' ' ~ 'vehicle.warranty.duration.suffix'|trans({}, 'DocumentTrans' ) : null }, { 'label': 'vehicle.warranty.end_date.title', 'content': vehicleData.warrantyEndDate is not null ? vehicleData.warrantyEndDate|date("d/m/Y") : null }, { 'label': 'vehicle.warranty.mileage.include', 'content': vehicleData.warrantyKilometric is not null ? vehicleData.warrantyKilometric ~ ' Km ' : null } ] }, ] %} {% if object.type != constant('AppBundle\\Entity\\Administrative\\Invoice\\InvoiceBase::INVOICE_TYPE_REPAIR_ORDER') or isDisplayHeaderInfo == true %} {% set headerInfo = headerInfo|merge([ { 'label': 'administrative.unit_price', 'class': 'w-11', 'display': true }, { 'label': 'service.qte', 'class': 'w-5', 'display': true }, { 'label': 'service.total_ht', 'class': 'w-12', 'display': true }, { 'label': 'administrative.price_without_tax_discount', 'class': 'w-12', 'display': isDiscount ? true : false }, { 'label': 'administrative.total.price_without_tax_discount', 'class': 'w-12', 'display': isDiscount ? true : false }, { 'label': 'administrative.tax', 'class': 'w-10', 'display': true }, { 'label': 'administrative.total.price_with_tax', 'class': 'w-12', 'display': true }, ]) %} {% endif %} {% if object.type != constant('AppBundle\\Entity\\Administrative\\Invoice\\InvoiceBase::INVOICE_TYPE_REPAIR_ORDER') %} {% set contentInfo = contentInfo|merge([ {'value': sellingData.prices.vehicles.sellPriceWithoutTaxWithoutDiscount|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol}, {'value': 1}, {'value': sellingData.prices.vehicles.sellPriceWithoutTaxWithoutDiscount|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol}, {'value': isDiscount ? beforValueDiscount ~ sellingData.prices.vehicles.priceDiscount|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol : null} , {'value': isDiscount ? sellingData.prices.vehicles.sellPriceWithoutTaxWithDiscount|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol : null} , {'value': sellingData.vehicleSellings|first.taxName|trans({}, 'DocumentTrans') ~ afterTaxname}, {'value': sellingData.prices.vehicles.sellPriceWithTax|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol}, ]) %} {% endif %} {% set notPourcentTaxName = ['tax.name.exo','tax.name.marge','tax.name.neutral','tax.name.exemption', null] %} {% set afterTaxname = sellingData.vehicleSellings|first.taxName in notPourcentTaxName ? null : '%' %} {% block vehicle %} {% set data = { "header_table": headerInfo, "content_table": contentInfo, } %} {% if object.type != constant('AppBundle\\Entity\\Administrative\\Invoice\\InvoiceBase::INVOICE_TYPE_REPAIR_ORDER') %} {% set vehicleSellingType %} {% if vehicleData.voVnType == "VN" %} {{ 'vehicle.selling.new'|trans({}, 'DocumentTrans' )}} {% else %} {% if isClassicAutostore is defined and isClassicAutostore == true %} {{ 'vehicle.selling.old'|trans({}, 'DocumentTrans' )}} {% else %} {{ 'vehicle.selling.used'|trans({}, 'DocumentTrans' )}} {% endif %} {% endif %} {% endset %} {% set vehicleSellingTitle = 'vehicle.selling.title'|trans({ '%type%' : vehicleSellingType }, 'DocumentTrans' ) %} {% endif %} {% block vehicle_title %} {% endblock vehicle_title %} {% block vehicle_data %} {% endblock vehicle_data %}
{% include 'AppBundle:Documents:v2\\Include\\Global\\title_content.html.twig' %}
{% for item in data['header_table'] %} {% if item.display == true %} {% endif %} {% endfor %} {% if vehicleData is not empty %} {% for item in data['content_table'] %} {% if item.value is not null %} {% endif %} {% endfor %} {% if isDisplayHeaderInfo == true %} {% endif %} {% endif %} {% for serviceList in sellingData.serviceSellings %} {% set afterTaxname = serviceList.sellTaxName in notPourcentTaxName ? null : '%' %} {% if isDiscount %} {% endif %} {% endfor %} {% if vehiclePartExchangeData is not empty and vehiclePartExchangeData.vehicleData is not empty %} {% set partExchangeUnitPriceWithoutTax = - vehiclePartExchangeData.priceWithoutTax %} {% set partExchangeSellPriceWithoutTax = - vehiclePartExchangeData.priceWithoutTax %} {% set partExchangeSellPriceWithTax = - vehiclePartExchangeData.priceWithTax %} {% set afterTaxname = vehiclePartExchangeData.taxName in notPourcentTaxName ? null : '%' %} {% if isDiscount %} {% endif %} {% endif %} {% if object.type == constant('AppBundle\\Entity\\Administrative\\Invoice\\InvoiceBase::INVOICE_TYPE_REPAIR_ORDER') %} {% else %} {% if sellingData.prices.priceDiscount %} {% endif %} {% endif %}
{{ item.label|trans({}, 'DocumentTrans') }}
{% if item.value is iterable %} {% if vehicleSellingTitle is not null %}

{{ vehicleSellingTitle }} {% if vehicleData.internalReference is not empty %} [{{ vehicleData.internalReference }}] {% endif %}

{% endif %} {% for v in item.value %} {% if v.content is not null %}

{{ v.label|trans({}, 'DocumentTrans') }} : {{ v.content }}

{% endif %} {% endfor %} {% else %} {{ item.value }} {% endif %}
{{ serviceList.reference }}

{{ serviceList.name }}

{% if serviceList.serviceArticleSellingList|length > 0 %} {% for serviceFlatRateSelling in serviceList.serviceArticleSellingList %}

{{ serviceFlatRateSelling.serviceArticleName }}

{% endfor %} {% endif %}
{{ serviceList.sellUnitPriceWithoutTax|number_format(2, ',', '') }} {{ currencySymbol }} {{ serviceList.quantity }} {{ serviceList.sellPriceWithoutTaxWithoutDiscount|number_format(2, ',', '') }} {{ currencySymbol }} {{ beforValueDiscount }} {{ serviceList.priceDiscount|number_format(2, ',', '') }} {{ currencySymbol }} {{ serviceList.sellPriceWithoutTax|number_format(2, ',', '') }} {{ currencySymbol }} {{ serviceList.sellTaxName|trans({}, 'DocumentTrans') ~ afterTaxname}} {{ serviceList.sellPriceWithTax|number_format(2, ',', ' ') }} {{ currencySymbol }}
{% if vehiclePartExchangeData.vehicleData.voVnType is not empty %} {{ vehiclePartExchangeData.vehicleData.voVnType }} {% endif %} {{ 'vehicle.part_exchange.title'|trans({}, 'DocumentTrans') }} : {% if vehiclePartExchangeData.vehicleData.brand is not empty %} {{ vehiclePartExchangeData.vehicleData.brand }}, {% endif %} {% if vehiclePartExchangeData.vehicleData.model is not empty %} {{ vehiclePartExchangeData.vehicleData.model }}, {% endif %} {% if vehiclePartExchangeData.vehicleData.version is not empty %} {{ vehiclePartExchangeData.vehicleData.version }}, {% endif %} {% if vehiclePartExchangeData.vehicleData.dateOfDistribution is not empty %} {{ vehiclePartExchangeData.vehicleData.dateOfDistribution|date('d/m/y') }}, {% endif %} {% if vehiclePartExchangeData.vehicleData.distanceTraveled is not empty %} {{ vehiclePartExchangeData.vehicleData.distanceTraveled }} Km, {% endif %} {% if vehiclePartExchangeData.vehicleData.licenseNumber is not empty %} {{ vehiclePartExchangeData.vehicleData.licenseNumber }}, {% endif %} {% if vehiclePartExchangeData.vehicleData.vin is not empty %} {{ vehiclePartExchangeData.vehicleData.vin }} {% endif %} {{ partExchangeUnitPriceWithoutTax|number_format(2, ',', ' ') }} {{ currencySymbol }} 1 {{ partExchangeSellPriceWithoutTax|number_format(2, ',', ' ') }} {{ currencySymbol }} {{ partExchangeSellPriceWithoutTax|number_format(2, ',', ' ') }} {{ currencySymbol }} {{ vehiclePartExchangeData.taxName|trans({}, 'DocumentTrans') ~ afterTaxname }} {{ partExchangeSellPriceWithTax|number_format(2, ',', ' ') }} {{ currencySymbol }}
{{ 'administrative.total.title'|trans({}, 'DocumentTrans') }} {{ sellingData.prices.sellPriceWithoutTaxWithoutDiscountExclPartExch|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol}} {{ beforValueDiscount }} {{ sellingData.prices.priceDiscount|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol}} {{ sellingData.prices.sellPriceWithoutTaxWithDiscountExclPartExch|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol}} {{ sellingTaxData.totalTax|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol}} {{ sellingData.prices.sellPriceWithTaxExclPartExch|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol}}
{% include "AppBundle:Documents:v2\\Include\\Administrative\\mentions.html.twig" %} {% endblock vehicle %} {% block note %} {% include "AppBundle:Documents:v2\\Include\\Administrative\\Invoice\\note.html.twig" %} {% endblock note %} {% block payment %} {% include 'AppBundle:Documents:v2\\Include\\Administrative\\payments.html.twig' with { 'block_title' : (hasDelivery == true ? 'subtitle.payment_method' : 'subtitle.billing_method'), 'hasDelivery': hasDelivery } %} {% endblock payment %} {% include 'AppBundle:Documents:v2\\Include\\Administrative\\collectedTax.html.twig' %} {% block summary %} {% include 'AppBundle:Documents:v2\\Include\\Administrative\\summary.html.twig' with { 'block_title' : 'summary', 'hasExchange': hasExchange, 'displayPayments': true } %} {% endblock summary %} {% endblock content %} {% block signature %} {% endblock signature %}