{% set vehicleSellings = sellingData.vehicleSellings is defined and sellingData.vehicleSellings|length > 0 ? sellingData.vehicleSellings : null %} {% set serviceSellings = sellingData.serviceSellings is defined and sellingData.serviceSellings|length > 0 ? sellingData.serviceSellings : null %} {% set vehiclePartExchange = sellingData.partExchangePurchase %} {% set hasPayments = displayPayments == true and sellingData.payments is not empty and sellingData.payments|length > 0 %} {% set vehicleSellingsColumnWidth = 30 %} {% set serviceSellingsColumnWidth = 30 %} {% set partExchangeColumnWidth = 20 %} {% set paymentsColumnWidth = 20 %}
{{ block_title|trans({}, 'DocumentTrans') }} {% set emptyColumnWidth = 100 %} {% if vehicleSellings is not null %} {% set emptyColumnWidth = (emptyColumnWidth - vehicleSellingsColumnWidth) %} {% endif %} {% if serviceSellings is not null %} {% set emptyColumnWidth = (emptyColumnWidth - serviceSellingsColumnWidth) %} {% endif %} {% if hasExchange == true %} {% set emptyColumnWidth = (emptyColumnWidth - partExchangeColumnWidth) %} {% endif %} {% if hasPayments == true %} {% set emptyColumnWidth = (emptyColumnWidth - paymentsColumnWidth) %} {% endif %} {% if emptyColumnWidth > 0 %} {% endif %} {% if vehicleSellings is not null %} {% endif %} {% if serviceSellings is not null %} {% endif %} {% if hasExchange == true %} {% endif %} {% if hasPayments == true %} {% set nbDownPayments = 0 %} {% set nbLoans = 0 %} {% set nbPayments = 0 %} {% for payment in sellingData.payments %} {% set isDeposit = payment.isDeposit == true %} {% set isLoan = payment.isLoan == true %} {% set isPayment = payment.isLoan == false and payment.isDeposit == false %} {% if isDeposit == true %} {% set nbDownPayments = nbDownPayments + 1 %} {% elseif isLoan == true %} {% set nbLoans = nbLoans + 1 %} {% elseif isPayment == true %} {% set nbPayments = nbPayments + 1 %} {% endif %} {% endfor %} {% endif %}

{% if notShowColumnTaxAndTotalWithTax == false %} {{ 'administrative.total.vehicle_price_with_tax'|transchoice(vehicleSellings|length, {}, 'DocumentTrans') }} {% else %} {{ 'administrative.total.vehicle_price_without_tax'|transchoice(vehicleSellings|length, {}, 'DocumentTrans') }} {% endif %} {{ sellingData.prices.vehicles.sellPriceWithTax|number_format(2, ',', ' ') }} {{ currencySymbol }}

{% if notShowColumnTaxAndTotalWithTax == false %} {{ 'administrative.total.service_price_with_tax'|transchoice(serviceSellings|length, {}, 'DocumentTrans') }} {% else %} {{ 'administrative.total.service_price_without_tax'|transchoice(serviceSellings|length, {}, 'DocumentTrans') }} {% endif %} {{ sellingData.prices.services.sellPriceWithTax|number_format(2, ',', ' ') }} {{ currencySymbol }}

{{ 'vehicle.part_exchange.title'|trans({}, 'DocumentTrans' ) }} - {{ sellingData.prices.partExchange.priceWithTax|number_format(2, ',', ' ') }}{{ currencySymbol }}

{% if nbDownPayments > 0 and nbLoans > 0 or nbPayments > 0 %} {{ 'payment.payment'|transchoice(sellingData.payments|length, {}, 'DocumentTrans' ) }} {% elseif nbDownPayments > 0 %} {{ 'payment.down_payment'|transchoice(nbDownPayments, {}, 'DocumentTrans' ) }} {% elseif nbLoans > 0 %} {{ 'payment.loan'|transchoice(nbLoans, {}, 'DocumentTrans' ) }} {% else %} {{ 'payment.bill'|trans({}, 'DocumentTrans') }} {% endif %} {{ sellingData.prices.payments.amount|number_format(2, ',', ' ') }} {{ currencySymbol }}

{% if sellingData.funding > 0 %} {% endif %} {% if displayPayments == true %} {% endif %}

{% if notShowColumnTaxAndTotalWithTax == false %} {{ 'administrative.total.price_with_tax'|trans({}, 'DocumentTrans' ) }} {% else %} {{ 'administrative.total.price_without_tax'|trans({}, 'DocumentTrans' ) }} {% endif %} {{ sellingData.sellPriceWithTax|replace(',', '.')|number_format(2, ',', ' ') }}{{ currencySymbol }}

{% if invoiceFunding is defined and invoiceFunding.choice == 'enumFundingChoice.personnal' %} {{ 'funding.choice.personal'|trans({}, 'DocumentTrans' ) }} {% else %} {{ 'funding.choice.yes'|trans({}, 'DocumentTrans' ) }} {% endif %} {{ sellingData.funding }}{{ currencySymbol }}

{{ 'payment.left_to_pay'|trans({}, 'DocumentTrans' ) }} {{ sellingData.balance|replace(',', '.')|number_format(2, ',', ' ') }}{{ currencySymbol }}