{% set totalOrderHt = 0 %}
{% set totalOrderTtc = 0 %}
{% set totalOrderHtTva = 0 %}
{% set totalProduct = 0 %}
{% set reduced = (order.cotisation.cotisationType.tag ?? '') == 'integral' and (order.cotisation.priceNationalPartCalculated ?? 0) > (order.cotisation.priceNationalPart ?? 0) %}
<style>
* {
font-size: 0.8em;
}
h1, h2, h3, h4, h5, h6, .title {
color: #f8772d !important;
}
.header {
background-color: #323b74 !important;
color: #FFFFFF !important;
text-transform: uppercase !important;
border: 1px solid #323b74 !important;
}
.col-45 {
width: 45% !important;
}
.col-10 {
width: 10% !important;
}
.col-20 {
width: 20% !important;
}
table {
border-collapse: collapse;
}
table th,
table td {
font-size: 0.8em;
}
table.no-border,
table.no-border th,
table th,
table.no-border td
table td {
border: 0 !important;
}
table td {
vertical-align: top;
}
table.no-border th.col-border,
table th.col-border {
border-left: 1px solid rgba(50, 59, 116, 0.2) !important;
border-right: 1px solid rgba(50, 59, 116, 0.2) !important;
border-bottom: 1px solid rgba(50, 59, 116, 0.2) !important;
border-top: 1px solid rgba(50, 59, 116, 0.2) !important;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
min-height: 50px;
}
table td.col-border,
table.no-border td.col-border {
border-left: 1px solid rgba(50, 59, 116, 0.2) !important;
border-right: 1px solid rgba(50, 59, 116, 0.2) !important;
border-bottom: 1px solid rgba(50, 59, 116, 0.2) !important;
}
table td.col-border-left,
table.no-border td.col-border-left,
table th.col-border-left,
table.no-border th.col-border-left {
border-left: 1px solid rgba(50, 59, 116, 0.2) !important;
}
table td.col-border-right,
table.no-border td.col-border-right,
table th.col-border-right,
table.no-border th.col-border-right {
border-right: 1px solid rgba(50, 59, 116, 0.2) !important;
}
table td.col-border-bottom,
table.no-border td.col-border-bottom,
table th.col-border-bottom,
table.no-border th.col-border-bottom {
border-bottom: 1px solid rgba(50, 59, 116, 0.2) !important;
}
table td.col-border-top,
table.no-border td.col-border-top,
table th.col-border-top,
table.no-border th.col-border-top {
border-top: 1px solid rgba(50, 59, 116, 0.2) !important;
}
.cell-header {
background-color: #323b74 !important;
color: #ffffff;
border: 1px solid #323b74 !important;
}
.align-left {
text-align: left;
}
.label {
font-weight: bold !important;
float: right !important;
}
.value {
float: left !important;
}
.cell-padding {
padding: 5px;
}
.mb-2 {
margin-bottom: 1em;
}
.mb-3 {
margin-bottom: 1.5em;
}
.mb-4 {
margin-bottom: 2em;
}
.mb-5 {
margin-bottom: 3em;
}
.col-pt td {
padding-top: 5px;
}
.text-small {
font-size: 0.7em;
}
</style>
<page>
<div class="mb-2" style="text-align: center;">
<img src="{{ asset('build/backend/images/ffcb_logo.jpg', 'backend') }}" style="width: 150px; height: auto;" alt="Logo FFCB">
</div>
<h3 class="mb-3" style="padding-top: 25px; text-align: center; width: 100%">Facture {{ order.generateInvoiceNumber }}</h3>
<table class="no-border mb-3" style="width: 100%">
<thead>
<tr>
<th class="header col-border align-left cell-padding col-45">FFCB</th>
<th class="col-10"></th>
<th class="header col-border align-left cell-padding col-45">Livraison</th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-border cell-padding">
<div class="mb-2">
{{ address|nl2br }}
</div>
<br>
<div class="mb-2">
<span class="label">Tél: </span>
<span class="value">{{ phone }}</span>
</div>
<br>
<div class="mb-2">
<span class="label">Email: </span>
<span class="value">{{ email }}</span>
</div>
<br>
</td>
<td></td>
<td class="col-border cell-padding">
{{ order.firm.raisonSocial }}<br><br>
{{ displayAddress(order.deliveryAddress) }}
</td>
</tr>
</tbody>
</table>
<table class="no-border mb-3" style="width: 100%">
<tbody>
<tr>
<td>Banque: <span style="color: darkred">{{ bank }}</span></td>
</tr>
<tr>
<td>IBAN: <span style="color: darkred">{{ iban }}</span></td>
</tr>
<tr>
<td>BIC: <span style="color: darkred">{{ bic }}</span></td>
</tr>
</tbody>
</table>
<table class="no-border mb-5" style="width: 100%;">
<thead>
<tr>
<th class="header col-border cell-padding align-left col-45">{{ order.cotisation ? ( 'Type de cotisation: ' ~ (order.cotisation.cotisationType.name ?? '') ~ ' - ' ~ (order.cotisation.year ?? '')) : 'Produits' }}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-border cell-padding">
<table style="width: 100%;">
<thead>
<tr>
<th class="align-left">Code</th>
<th class="align-left">{{ order.cotisation ? 'Désignation' : 'Produit' }}</th>
<th class="align-left">Quantité</th>
<th class="align-left">Prix unit. HT</th>
<th class="align-left">Prix total. HT</th>
<th class="align-left">Taux Tva</th>
<th class="align-left">Prix total TTC</th>
</tr>
</thead>
<tbody class="col-pt">
{% for line in order.orderLines %}
<tr>
<td>{{ line.product.code|upper }}</td>
<td>{{ line.product.name }}{{ reduced and line.product.code|upper == 'PARTN' ? '*' }}</td>
<td>{{ line.quantity }}</td>
<td>{{ line.unitPrice|number_format(2, ',', ' ') }} €</td>
<td>{{ line.totalPrice|number_format(2, ',', ' ') }} €</td>
<td>{{ line.vat }}%</td>
<td>{{ (line.totalPrice * (1 + line.vat / 100))|number_format(2, ',', ' ') }} €</td>
</tr>
{% if line.vat > 0 %}
{% set totalOrderHtTva = totalOrderHtTva + (totalOrderHt * line.quantity) %}
{% endif %}
{% set totalOrderHt = totalOrderHt + (line.unitPrice * line.quantity) %}
{% set totalOrderTtc = totalOrderTtc + (line.totalPrice * (1 + line.vat / 100)) %}
{% set totalProduct = totalProduct + line.quantity %}
{% endfor %}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table class="no-border" style="width: 100%">
<thead>
<tr>
<th class="header col-border cell-padding align-left col-45">Récapitulatif des échéances</th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-border cell-padding">
<table style="width: 100%;">
<thead>
<tr>
<th class="align-left">Date</th>
<th class="align-left">Date de paiement</th>
<th class="align-left">Date échéance</th>
<th class="align-left">Mode de règlement</th>
<th class="align-left">Réf de la Commande</th>
</tr>
</thead>
<tbody class="col-pt">
<tr>
<td class="col-20">{{ (order.invoiceDate ?? order.orderDate)|date('d/m/Y') }}</td>
<td class="col-20">{{ order.cotisation and order.cotisation.datePaiement ? order.cotisation.datePaiement|date('d/m/Y') }}</td>
<td class="col-20">{{ order.invoiceDate|date('d/m/Y') }}</td>
<td class="col-20">{{ order.paymentType.name|upper }}</td>
<td class="col-20">{{ order.number }}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<div class="mb-5 text-small">
<small><i>{{ notice }}</i></small>
</div>
{% if reduced %}
<div class="mb-5 text-small">
<small><i>* Le montant de la part nationale calculé de {{ order.cotisation.priceNationalPartCalculated|number_format(2, ',', ' ') }} € HT a été plafonné à {{ order.cotisation.priceNationalPart|number_format(2, ',', ' ') }} € HT</i></small>
</div>
{% endif %}
<table class="no-border" style="width: 100%">
<tbody>
<tr>
<td class="col-45"></td>
<td class="col-10"></td>
<td class="col-border col-border-top" style="padding: 0;">
<table class="no-border" style="width: 100%;">
<tbody class="col-pt">
<tr>
<th class="cell-header">Total HT</th>
<td>{{ (order.cotisation ? order.cotisation.priceHt : totalOrderHt)|number_format(2, ',', ' ') }} €</td>
</tr>
<tr>
<th class="cell-header">Total TVA</th>
<td>{{ (order.cotisation ? order.cotisation.priceVat : (totalOrderTtc - totalOrderHt))|number_format(2, ',', ' ') }} €</td>
</tr>
<tr>
<th class="cell-header">Total TTC</th>
<td>{{ (order.cotisation ? order.cotisation.priceTtc : totalOrderTtc)|number_format(2, ',', ' ') }} €</td>
</tr>
<tr>
<th class="cell-header">Net à payer</th>
<td>{{ (order.cotisation ? order.cotisation.priceTtc : totalOrderTtc)|number_format(2, ',', ' ') }} €</td>
</tr>
<tr>
<th class="cell-header">Solde dû</th>
<td>{{ order.status == constant('App\\Entity\\Order::STATUS_PAID') ? 0 : (order.cotisation ? order.cotisation.priceTtc : totalOrderTtc)|number_format(2, ',', ' ') }} €</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</page>