{% set totalOrderHtTva = 0 %}
{% set totalOrderHt = 0 %}
{% set totalOrderTtc = 0 %}
{% set totalProduct = 0 %}
{% set reduced = (cotisation.cotisationType.tag ?? '') == 'integral' and (cotisation.priceNationalPartCalculated ?? 0) > (cotisation.priceNationalPart ?? 0) %}
<div class="card {{ attrs.class ?? '' }}">
<div class="card-header card-header-dark">
{{ title }}
</div>
<div class="card-body card-body-dark">
{% if displayStatus is defined and displayStatus == true %}
<div class="row mb-3">
<div class="col-2 text-bold">Statut</div>
<div class="col-10">{{ bagdeStatusCotisation(cotisation.cotisationStatut.id) }}</div>
</div>
{% endif %}
{% if displayFirm is defined and displayFirm == true %}
<div class="row mb-3">
<div class="col-2 text-bold">Entreprise</div>
<div class="col-10">{{ cotisation.entreprise.raisonSocial }}</div>
</div>
{% endif %}
<div class="row mb-3">
<div class="col-2 text-bold">Type d'offre</div>
<div class="col-10">
{{ cotisation.cotisationType ? cotisation.cotisationType.name : 'Autre' }}
{% if cotisation.cotisationType and cotisation.cotisationType.tag == 'young_member' %}
<span><i> - Année {{ cotisation.youngMemberYearNumber }}</i></span>
{% endif %}
</div>
</div>
<div class="row mb-3">
<div class="col-2 text-bold">Chiffre d'affaire</div>
<div class="col-10">{{ cotisation.revenue ? cotisation.revenue|number_format(2, ',', ' ') ~ ' €' }}</div>
</div><div class="row mb-3">
<div class="col-2 text-bold">Date de cloture du dernier exercice</div>
<div class="col-10">{{ cotisation.revenueDate ? cotisation.revenueDate|date('d/m/Y') }}</div>
</div>
<div class="row mb-3">
<div class="col-2 text-bold">Justificatif CA</div>
<div class="col-10">
{% if cotisation.document %}
<a href="{{ vich_uploader_asset(cotisation, 'documentFile') }}" target="_blank">
{{ cotisation.originalDocumentName is null ? cotisation.document : cotisation.originalDocumentName }}
</a>
{% endif %}
</div>
</div>
{% set order = cotisation.associetedOrder %}
{% if order %}
<table class="mt-5 mb-5 table table-striped" style="width: 100%;">
<thead class="thead-dark">
<tr>
<th class="align-left">Code</th>
<th class="align-left">{{ 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>
{% endif %}
{% if displayPaymentDate is defined and displayPaymentDate == true %}
<div class="row mb-3">
<div class="col-2 text-bold">Date de paiement</div>
<div class="col-10">{{ cotisation.datePaiement ? cotisation.datePaiement|date('d/m/Y') }}</div>
</div>
{% endif %}
{% if displayProofOfPayment is defined and displayProofOfPayment == true %}
<div class="row mb-3">
<div class="col-2 text-bold">Justificatif paiement</div>
<div class="col-10">
{% if cotisation.proofOfPayment %}
<a href="{{ vich_uploader_asset(cotisation, 'proofOfPaymentFile') }}" target="_blank">
{{ cotisation.originalProofOfPaymentName is null ? cotisation.proofOfPayment : cotisation.originalProofOfPaymentName }}
</a>
{% endif %}
</div>
</div>
{% endif %}
{% if displayComment is defined and displayComment == true %}
<hr>
<div class="row mb-3">
<div class="col-2 text-bold">Commentaire</div>
<div class="col-10">{{ cotisation.commentaire|raw }}</div>
</div>
{% endif %}
{% if
displayPaymentInfo is defined and
displayPaymentInfo == true and
paymentInfos is defined and
paymentInfos|length > 0 and
(cotisation.associetedOrder and cotisation.associetedOrder.paymentType.id == 2)
%}
<hr>
<div class="row mb-3">
<div class="col-2 text-bold">Informations de paiement</div>
<div class="col-10">
<div class="alert alert-info">
{% for info in paymentInfos %}
{% if info.valuetype == 'file' %}
{% if info.value %}
<a
href="{{ rib.value }}"
class="btn btn-primary"
download
>
<i class="fa-solid fa-download"></i> Télécharger le RIB de la FFCB
</a>
{% endif %}
{% else %}
<div class="mb-3">
<span class="text-bold">{{ info.title|capitalize }}: </span>
<span>{{ info.value }}</span>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
</div>
</div>