{% extends 'backend/base.html.twig' %}
{% block title %}Cotisation entreprise {{ entreprise.raisonSocial }}{% endblock %}
{% block content %}
{% include 'backend/partials/_breadcrumb.html.twig' with {
datas: [
{label: 'Entreprises', url: path('advanced_search', {entity: 'entreprise'})},
{
label: entreprise.raisonSocial ~ ' <i>(#' ~ entreprise.id ~ ')</i>',
url: path('show_entreprise', {'id': entreprise.id})
}, {
label: 'Cotisation(s)'
}
],
buttons: [
{
display: true,
url: path('show_entreprise', {'id': entreprise.id }),
class: 'btn btn-sm btn-secondary',
icon: 'fas fa-chevron-left',
label: 'Retour'
}
]
} %}
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Année</th>
<th>Statut</th>
<th>Total TTC</th>
<th>Date de paiement</th>
<th class="text-center">Action(s)</th>
</tr>
</thead>
<tbody>
{% for key, cotisation in entreprise.cotisations|filter(el => el.status != constant('App\\Entity\\Order::STATUS_ARCHIVED')) %}
<tr>
<td>
<a href="{{ path('show_cotisation',{'id': cotisation.id }) }}">
{{ cotisation.year }}
</a>
</td>
<td>{{ bagdeStatusCotisation(cotisation.cotisationStatut.id) }}</td>
<td>{{ cotisation.priceTtc ? cotisation.priceTtc|number_format(2, ',', ' ') ~ ' €' }}</td>
<td>{{ cotisation.datePaiement ? cotisation.datePaiement|date('d/m/Y') }}</td>
<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_ADMIN') %}
<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') %}
<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 %}
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% if entreprise.cotisations|filter(el => el.status == constant('App\\Entity\\Order::STATUS_ARCHIVED'))|length %}
<div class="card">
<div class="card-body">
<h4 class="mb-4">Cotisations archivées</h4>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Année</th>
<th>Statut</th>
<th>Total TTC</th>
<th>Date de paiement</th>
<th class="text-center">Action(s)</th>
</tr>
</thead>
<tbody>
{% for key, cotisation in entreprise.cotisations|filter(el => el.status == constant('App\\Entity\\Order::STATUS_ARCHIVED')) %}
<tr>
<td>
<a href="{{ path('show_cotisation',{'id': cotisation.id }) }}">
{{ cotisation.year }}
</a>
</td>
<td>{{ bagdeStatusCotisation(cotisation.cotisationStatut.id) }}</td>
<td>{{ cotisation.priceTtc ? cotisation.priceTtc|number_format(2, ',', ' ') ~ ' €' }}</td>
<td>{{ cotisation.datePaiement ? cotisation.datePaiement|date('d/m/Y') }}</td>
<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_ADMIN') %}
<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') %}
<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 %}
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
{% endblock %}