<div class="table-responsive">
<table class="display table table-striped table-bordered">
<thead>
<tr>
<th class="text-center" width="5%">
<input type="checkbox" id="check-all" onclick="javascript:checkAllElt()">
</th>
<th width="10%">Code</th>
<th>Libellé</th>
<th class="text-center">Montant</th>
<th class="text-center">Mt Payé</th>
<th class="text-center">Mt Restant</th>
<th class="text-center">Mt Annulé/Reporté</th>
<th class="text-center">Validité</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
{% set amount = 0 %}
{% set amountPaid = 0 %}
{% set amountRest = 0 %}
{% set amountCancel = 0 %}
{% for accounting_student_registration_fee in registration_student_registration.accountingStudentRegistrationFees %}
{# {% if not accounting_student_registration_fee.isArchived %} #}
{% if not accounting_student_registration_fee.isArchived or accounting_student_registration_fee.isReported %}
{% set amount = amount + accounting_student_registration_fee.amount %}
{% set amountPaid = amountPaid + accounting_student_registration_fee.amountPaid %}
{% set amountRest = amountRest + accounting_student_registration_fee.amountRest %}
{% set amountCancel = amountCancel + accounting_student_registration_fee.amountCancel %}
{% endif %}
<tr {% if accounting_student_registration_fee.isArchived or accounting_student_registration_fee.isReported %} style="color: red !important;"{% endif %}>
<td class="text-center">
{% if not accounting_student_registration_fee.isArchived and not accounting_student_registration_fee.isReported or is_granted('ROLE_SUPER_ADMIN') %}
<input type="checkbox" class="check-elt" value="{{ accounting_student_registration_fee.id }}" onclick="javascript:checkElt()">
{% endif %}
</td>
<td>#{{ accounting_student_registration_fee.code }}({{ accounting_student_registration_fee.id }})</td>
<td>{{ accounting_student_registration_fee.label }}</td>
<td class="text-center">{{ accounting_student_registration_fee.amount|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ accounting_student_registration_fee.amountPaid|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ accounting_student_registration_fee.amountRest|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ accounting_student_registration_fee.amountCancel|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ accounting_student_registration_fee.endAt ? accounting_student_registration_fee.endAt|date('d/m/Y') : 'Indefini' }}</td>
<td class="text-right">
{% if not accounting_student_registration_fee.isArchived and not accounting_student_registration_fee.isReported %}
{% if is_granted('ROLE_ADMIN') %}
{% if accounting_student_registration_fee.amountRest > 0 %}
{% if not accounting_student_registration_fee.isCancel %}
<a href="#" onclick="javascript:actionByPathAndElts('{{path('accounting_student_registration_fee_cancel', {'id': accounting_student_registration_fee.id})}}')" class="btn btn-warning btn-sm" title="Abandonner">ABANDONNER</a>
{% endif %}
{% endif %}
{% endif %}
{% if is_granted('ROLE_ADMIN') %}
<a href="{{ path('accounting_student_registration_fee_edit', {'id': accounting_student_registration_fee.id}) }}" class="btn btn-primary"><i class="fa fa-calendar"></i> ECHEANCIER</a>
{% endif %}
{% endif %}
</td>
</tr>
{# {% endif %} #}
{% endfor %}
<tr>
<td class="text-center"></td>
<td></td>
<td class="text-right"><b>TOTAL</b></td>
<td class="text-center"><b>{{ registration_student_registration.gleAmount|number_format(0, ',', ' ') }}</b></td>
<td class="text-center"><b>{{ registration_student_registration.amountPaid|number_format(0, ',', ' ') }}</b></td>
<td class="text-center"><b>{{ registration_student_registration.amountRest|number_format(0, ',', ' ') }}</b></td>
<td class="text-center"><b>{{ registration_student_registration.amountCancel|number_format(0, ',', ' ') }}</b></td>
<td class="text-center"></td>
<td class="text-right"></td>
</tr>
</tbody>
</table>
</div>