{# @var \App\Entity\Cotisation cotisation #}
<div class="mt-2">
{% include 'backend/partials/_table_result_header.html.twig' with {
entityName: 'Cotisation(s)',
count: advancedSearchResults.getTotalItemCount,
showExportButtons: searchParams.is_exportable,
buttons: [{
display: is_granted('ROLE_ADD_ENTITY') ? true : false,
url: path('add_cotisation'),
class: 'btn btn-sm btn-success',
icon: 'fas fa-plus',
label: 'Ajouter'
}]
} %}
<div class="table-responsive">
<table class="table" id="table-result">
<thead>
<tr>
<th>Année</th>
<th>Statut paiement</th>
<th>Type offre</th>
<th class="text-center">Import / Export</th>
<th class="text-center">MAPA</th>
<th>Date paiement</th>
<th>Total TTC</th>
<th>Raison Sociale</th>
<th>Commune/Ville</th>
<th>Code Postal</th>
<th>Département</th>
<th>Région</th>
<th># Entreprise</th>
<th>#</th>
{% if forNotDisplayArchived %}
<th>Statut</th>
{% endif %}
<th class="text-center">Actions</th>
</tr>
</thead>
<tbody>
{% for key, cotisation in advancedSearchResults %}
<tr>
<td>
{% if cotisation.year %}
<a href="{{ path('show_cotisation',{'id': cotisation.id }) }}">
{{ cotisation.year }}
</a>
{% endif %}
</td>
<td>
{% if cotisation.cotisationStatut %}
{{ bagdeStatusCotisation(cotisation.cotisationStatut.id) }}
{% endif %}
</td>
<td>{{ cotisation.cotisationType ? cotisation.cotisationType.name : 'Autre' }}</td>
<td class="text-center">{{ cotisation.optionImportExport ? 'Oui' : 'Non' }}</td>
<td class="text-center">{{ cotisation.optionMapa ? 'Oui' : 'Non' }}</td>
<td>{{ cotisation.datePaiement ? cotisation.datePaiement|date('d/m/Y') }}</td>
<td>{{ cotisation.priceTtc ? cotisation.priceTtc|number_format(2, ',', ' ') ~ ' €' }}</td>
<td>
{{ cotisation.entreprise.raisonSocial }}
</td>
<td>
{{ cotisation.entreprise.ville }}
</td>
<td>
{{ cotisation.entreprise.codePostal|trim }}
</td>
<td>
{% if cotisation.entreprise.departement %}
{{ cotisation.entreprise.departement.nom }}
{% endif %}
</td>
<td>
{% if cotisation.entreprise %}
{% if cotisation.entreprise.departement.regions is defined %}
{% for region in cotisation.entreprise.departement.regions %}
{{ region.nom }}
{% endfor %}
{% endif %}
{% endif %}
</td>
<td>{{ cotisation.entreprise.id }}</td>
<td>{{ cotisation.id }}</td>
{% if forNotDisplayArchived %}
<td>{{ bagdeStatus(cotisation.status, true) }}</td>
{% endif %}
<td class="text-center">
<button class="btn btn-outline-secondary btn-icon btn-rounded dropdown-toggle custom-dropdown"
type="button" id="dropdownMenu_{{ key }}" data-bs-toggle="dropdown"
aria-expanded="false">
<i class="fa-solid fa-ellipsis"></i>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu_{{ key }}">
<li>
<a class="dropdown-item" href="{{ path('show_cotisation',{'id': cotisation.id }) }}">
<i class="fas fa-eye"></i> Consulter
</a>
</li>
{% if is_granted('ROLE_UPDATE_ENTITY') %}
<li>
<a class="dropdown-item"
href="{{ path('edit_cotisation',{'id': cotisation.id }) }}">
<i class="fas fa-edit"></i> Editer
</a>
</li>
{% endif %}
{% if is_granted('ROLE_DELETE_ENTITY') %}
{% if cotisation.status == constant('App\\Entity\\Cotisation::STATUS_ARCHIVED') %}
{% if not cotisation.entreprise.statutPaiement %}
<li>
<a
class="dropdown-item"
href="#"
data-controller="confirm-delete"
data-confirm-delete-url-value="{{ path('enable_cotisation', {id: cotisation.id}) }}"
data-confirm-delete-message-value="Etes-vous sûr de vouloir activer cette cotisation ?"
data-confirm-delete-token-value="{{ csrf_token('cotisation_' ~ cotisation.id) }}"
data-confirm-delete-action-value="reload"
>
<i class="fas fa-check"></i> Activer
</a>
</li>
{% endif %}
{% else %}
<li>
<a
class="dropdown-item"
href="#"
data-controller="confirm-delete"
data-confirm-delete-url-value="{{ path('archive_cotisation', {id: cotisation.id}) }}"
data-confirm-delete-message-value="Etes-vous sûr de vouloir archiver cette cotisation ?"
data-confirm-delete-token-value="{{ csrf_token('cotisation_' ~ cotisation.id) }}"
data-confirm-delete-action-value="reload"
>
<i class="fas fa-archive"></i> Archiver
</a>
</li>
{% endif %}
{% endif %}
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="navigation mt-4 text-end">
{{ knp_pagination_render(advancedSearchResults) }}
</div>
</div>
</div>