{% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% import 'AppBundle:Documents:v2\\Import\\group.html.twig' as groupF %} {% set hasRental = isRental is defined and isRental == true %} {% set hasPayments = sellingData.payments is not empty and sellingData.payments|length > 0 %} {% set nbPayments = sellingData.payments|length %} {% set iban = groupF.getIban(groupData, {}) %} {% set swift = groupF.getSwift(groupData, {}) %} {% set domiciliation = groupF.getDomiciliation(groupData, {}) %} {% set hasGroupBankInfo = iban|trim is not empty or swift|trim is not empty or domiciliation|trim is not empty %} {% set invoiceFundingColumn = 35 %} {% if nbPayments > 1 or hasDelivery == true %} {% set invoiceFundingColumn = 20 %} {% endif %} {% set groupColumnWidth = 35 %} {% set deliveryColumnWidth = 25 %} {% set paymentColumnWidth = nbPayments > 1 ? 40 : 30 %} {% set tableWidth = '' %} {% if isPackaged is defined and true == isPackaged %} {% set groupColumnWidth = nbPayments > 1 ? 25 : groupColumnWidth %} {% set deliveryColumnWidth = nbPayments > 1 ? 24 : 35 %} {% set paymentColumnWidth = nbPayments > 1 ? 50 : 25 %} {% set tableWidth = 'w-100' %} {% endif %} {% if hasRental == true or hasDelivery == true or hasGroupBankInfo == true or hasPayments == true %}
{% include 'AppBundle:Documents:v2\\Include\\Global\\title_content.html.twig' with { 'title' : block_title|trans({}, 'DocumentTrans') } %}
{% set emptyColumnWidth = (100 - groupColumnWidth) %} {% if hasDelivery == true %} {% set emptyColumnWidth = (emptyColumnWidth - deliveryColumnWidth) %} {% endif %} {% if hasPayments == true %} {% set emptyColumnWidth = (emptyColumnWidth - paymentColumnWidth) %} {% endif %} {% if invoiceFunding.choice != "enumFundingChoice.no" %} {% set emptyColumnWidth = (emptyColumnWidth - invoiceFundingColumn) %} {% endif %} {% if emptyColumnWidth > 50 %} {% set emptyColumnWidth = 40 %} {% endif %} {% if emptyColumnWidth > 0 %} {% endif %} {% if hasRental == true %} {% endif %} {% if hasDelivery == true %} {% endif %} {% block bankDetails %} {% if hasGroupBankInfo == true %} {% endif %} {% endblock bankDetails %} {% if invoiceFunding.choice != "enumFundingChoice.no" %} {% endif %} {% if hasPayments == true %} {% endif %}
{{ 'payment_method.sub_title.rental_period'|trans({}, 'DocumentTrans') }}

{{ 'of_date'|trans({}, 'DocumentTrans' ) }}

{{ invoiceRentalStartPeriod|date('d/m/Y') }}

{{ 'to_date'|trans({}, 'DocumentTrans' ) }}

{{ invoiceRentalEndPeriod|date('d/m/Y') }}

 

 

{{ 'payment_method.sub_title.delivery_details'|trans({}, 'DocumentTrans') }}

{{ 'payment_method.delivery.date'|trans({}, 'DocumentTrans' ) }}

{{ sellingData.deliveryDate }}

{{ 'payment_method.delivery.place'|trans({}, 'DocumentTrans' ) }}

{{ sellingData.deliveryPlace }}

 

 

 
{{ 'payment_method.sub_title.bank_details'|trans({}, 'DocumentTrans') }}

{{ 'group.iban'|trans({}, 'DocumentTrans' ) }}

{{ iban }}

{{ 'group.swift_bic'|trans({}, 'DocumentTrans' ) }}

{{ swift }}

{{ 'group.domiciliation'|trans({}, 'DocumentTrans' ) }}

{{ domiciliation }}

 
{{ 'funding.title'|trans({}, 'DocumentTrans') }}

{% if invoiceFunding.choice == "enumFundingChoice.yes" %} {{ 'funding.choice.yes'|trans({}, 'DocumentTrans' ) }} {% elseif invoiceFunding.choice == "enumFundingChoice.personnal" %} {{ 'funding.choice.personal'|trans({}, 'DocumentTrans' ) }} {% endif %}

{% if invoiceFunding.amount is not empty %} {{ invoiceFunding.amount|number_format(2, ',', ' ') }} {{ currencySymbol }} {% endif %} {% if invoiceFunding.duration is not empty %} {{ 'funding.duration'|trans({'%duration%': invoiceFunding.duration}, 'DocumentTrans' ) }} {% endif %} {% if invoiceFunding.rate is not empty %} {{ 'funding.rate'|trans({'%rate%': invoiceFunding.rate}, 'DocumentTrans' ) }} {% endif %}

  {% set nbDownPayments = 0 %} {% set nbLoans = 0 %} {% for payment in sellingData.payments %} {% set paymentFields = { 'condition': { 'label': 'payment.bill', 'value': payment.condition }, 'amount': { 'label': 'payment.amount', 'value': payment.amount, 'type': 'currency' }, 'type': { 'label': 'payment.type', 'value': payment.mode }, 'bank': { 'label': 'payment.bank', 'value': payment.bank }, 'checkNumber': { 'label': 'payment.number', 'value': payment.checkNumber }, 'receiveDate': { 'label': 'payment.received', 'value': payment.receiveDate, 'type': 'date' }, 'termDate': { 'label': 'payment.deadline', 'value': payment.termDate, 'type': 'date' }, } %} {% set isDeposit = payment.isDeposit == true %} {% set isLoan = payment.isLoan == true %} {% if isDeposit == true %} {% set nbDownPayments = nbDownPayments + 1 %} {% elseif isLoan == true %} {% set nbLoans = nbLoans + 1 %} {% endif %} {% if loop.index0%2 == 0 %} {% if loop.index0 > 0 %} {% endif %} {% endif %} {% if loop.index0%2 == 1 %} {% endif %} {% if loop.last %} {% endif %} {% endfor %}
 
{% block titlePaymentDetails %} {% if isDeposit == true %} {{ 'payment_method.sub_title.down_payment'|trans({}, 'DocumentTrans') ~ nbDownPayments }} {% elseif isLoan == true %} {{ 'payment_method.sub_title.loan'|trans({}, 'DocumentTrans') ~ nbLoans }} {% else %} {{ 'payment.bill'|trans({}, 'DocumentTrans') }} {% endif %} {% endblock titlePaymentDetails %} {% set paymentFieldsFormatted = {} %} {% for k, item in paymentFields %} {% if item.value is not empty %} {% set paymentFieldsFormatted = paymentFieldsFormatted|merge({(k):item}) %} {% endif %} {% endfor %} {% for key, field in paymentFieldsFormatted %} {% if loop.index0%2 == 0 %} {% if loop.index0 > 0 %} {% endif %} {% endif %} {% if field.value is not empty %} {% endif %} {% if loop.last %} {% endif %} {% endfor %}

{{ field.label|trans({}, 'DocumentTrans' ) }}

{% if field.type == "currency" %} {{ field.value|number_format(2, ',', ' ') }}{{ currencySymbol }} {% elseif field.type == "date" %} {{ globalF.formatDate(field.value, {'timezone': timezone})|trim }} {% else %} {{ field.value }} {% endif %}

{% endif %}