<div class="table-responsive">
<table class="display table table-striped table-bordered">
<thead>
<tr>
<th class="text-center" width="5%">N°</th>
<th>Designation</th>
<th>Date d'échéance</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é</th>
<th width="10%" class="text-center">Action</th>
</tr>
</thead>
<tbody>
{% for accounting_student_registration_fee in registration_student_registration.accountingStudentRegistrationFees %}
{% if not accounting_student_registration_fee.isArchived %}
{% for accounting_student_registration_fee_shedul in accounting_student_registration_fee.accountingStudentRegistrationFeeSheduls %}
<tr>
<td class="text-center">{{ accounting_student_registration_fee_shedul.orderNum }}</td>
<td>{{ accounting_student_registration_fee.label }}</td>
<td>
{% if accounting_student_registration_fee_shedul.amountRest > 0 and is_granted("ROLE_RECOUVREMENT") %}
<input class="form-control" type="date" value="{{ accounting_student_registration_fee_shedul.dateDue ? accounting_student_registration_fee_shedul.dateDue|date('Y-m-d') }}" onchange="fee_shedul_update_date_due($(this), '{{ path('api_accounting_student_registration_fee_shedul_update_date_due', {'id': accounting_student_registration_fee_shedul.id})}}')" />
{% else %}
{{ accounting_student_registration_fee_shedul.dateDue ? accounting_student_registration_fee_shedul.dateDue|date('d/m/Y') }}
{% endif %}
</td>
<td class="text-center">{{ accounting_student_registration_fee_shedul.amount|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ accounting_student_registration_fee_shedul.amountPaid|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ accounting_student_registration_fee_shedul.amountRest|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ accounting_student_registration_fee_shedul.amountCancel|number_format(0, ',', ' ') }}</td>
<td class="text-center">
{% if is_granted('ROLE_ADMIN') %}
{% if accounting_student_registration_fee_shedul.amountCancel <= 0 %}
{% if accounting_student_registration_fee_shedul.amountRest > 0 %}
<a href="#" data-toggle="modal" data-target="#cancel{{ accounting_student_registration_fee_shedul.id }}Modal" class="btn btn-success btn-sm" title="Remise">Remise</a>
{% endif %}
{% endif %}
{% endif %}
{# <a href="#" onclick="javascript:actionByPathAndElts('{{path('accounting_student_registration_fee_shedul_cancel', {'id': accounting_student_registration_fee_shedul.id})}}')" class="btn btn-warning btn-sm" title="Remise">Remise</a> #}
{# {% if is_granted('ROLE_SUPER_ADMIN') %}
<a href="#" data-toggle="modal" data-target="#addFeeModal" onclick="javascript:actionByPathAndElts('{{path('accounting_student_registration_fee_shedul_delete', {'id': accounting_student_registration_fee_shedul.id})}}')" class="btn btn-danger btn-sm" title="Supprimer"><i class="fa fa-trash"></i></a>
{% endif %} #}
</td>
</tr>
<div class="modal fade" id="cancel{{ accounting_student_registration_fee_shedul.id }}Modal" tabindex="-1" role="dialog" aria-labelledby="cancel{{ accounting_student_registration_fee_shedul.id }}Modal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="cancel{{ accounting_student_registration_fee_shedul.id }}Modal_title">
Remise ({{ accounting_student_registration_fee.studentRegistration.student.name }}):
<br>{{ accounting_student_registration_fee.fee }}
<br>Echéance: {{ accounting_student_registration_fee_shedul.amount|number_format(0, ',', ' ') }}
<br>Reste: {{ accounting_student_registration_fee_shedul.amountRest|number_format(0, ',', ' ') }}
</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<form action="{{path('accounting_student_registration_fee_shedul_cancel', {'id': accounting_student_registration_fee_shedul.id})}}">
<div class="modal-body">
<div class="form-group">
<label class="col-form-label" for="shedulAmount">Montant:</label>
<input type="number" class="form-control" id="shedulAmount" name="shedulAmount" value="0">
<span class="text-danger">Cette action est irreversible, merci de bien vérifier avant de valider</label>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Annuler</button>
<button class="btn btn-primary" onclick="$('.loader').addClass('is-active');" type="submit">Valider</button>
</div>
</form>
</div>
</div>
</div>
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table>
</div>