<div class="table-responsive">
<table id="defaultDataTable" class="display table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th width="5%">
<input type="checkbox" id="check-all" onclick="javascript:checkAllElt()">
</th>
<th class="text-center">#</th>
<th>Nom & Prénoms</th>
<th class="text-center">Salaire catégoriel</th>
<th class="text-center">Total brute</th>
<th class="text-center">Brute fiscal</th>
<th class="text-center">Brute social</th>
<th class="text-center">Retenu part salarial </th>
{# <th class="text-center">Retenu part patronal</th> #}
<th class="text-center">Net à payer</th>
<th class="text-center">Etat</th>
<th width="15%" class="text-center">Action</th>
</tr>
</thead>
<tbody>
{% set based = 0 %}
{% set grossTotal = 0 %}
{% set taxGross = 0 %}
{% set socialGross = 0 %}
{% set netSalary = 0 %}
{% set withholdingTax = 0 %}
{% set patronalWithholdingTax = 0 %}
{% set count = 0 %}
{% for salary_pay_slip in rh_pay_slip.rhSalaryPaySlips %}
{% set based = based + salary_pay_slip.baseSalary %}
{% set grossTotal = grossTotal + salary_pay_slip.grossTotal %}
{% set taxGross = taxGross + salary_pay_slip.taxGross %}
{% set withholdingTax = withholdingTax + salary_pay_slip.withholdingTax %}
{% set patronalWithholdingTax = patronalWithholdingTax + salary_pay_slip.patronalWithholdingTax %}
{% set socialGross = socialGross + salary_pay_slip.socialGross %}
{% set netSalary = netSalary + salary_pay_slip.netSalary %}
{% set count = count + 1 %}
<tr>
<td>
<input type="checkbox" class="check-elt" value="{{ salary_pay_slip.id }}" onclick="javascript:checkElt()">
</td>
<td>{{ loop.index }}</td>
<td>{{ salary_pay_slip.rhSalary.name }} ({{ salary_pay_slip.rhSalary.isPermanent ? "Permanent(e)" : "Vacataire" }})</td>
<td class="text-center">{{ salary_pay_slip.baseSalary|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ salary_pay_slip.grossTotal|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ salary_pay_slip.taxGross|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ salary_pay_slip.socialGross|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ salary_pay_slip.withholdingTax|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ salary_pay_slip.netSalary|number_format(0, ',', ' ') }}</td>
<td class="text-center">{{ salary_pay_slip.isValidated ? 'Validé' : 'Brouillon' }}</td>
<td class="last text-center">
<a class="btn-sm btn-primary" onclick="$('.loader').addClass('is-active');" href="{{ path('rh_salary_pay_slip_edit', {'id': salary_pay_slip.id})}}"><i class="fa fa-edit"></i></a>
<a class="btn-sm btn-success" onclick="$('.loader').addClass('is-active');" href="{{ path('rh_salary_pay_slip_show', {'id': salary_pay_slip.id})}}"><i class="fa fa-eye"></i></a>
{% if not salary_pay_slip.isValidated %}
<a href="#" title="valider" class="btn-sm btn-success" onclick="javascript:actionByPathAndElts('{{path('rh_salary_pay_slip_validated', {'id': salary_pay_slip.id })}}')"><i class="fa fa-check"></i></a>
{% else %}
<a href="#" title="annuler" class="btn-sm btn-warning" onclick="javascript:actionByPathAndElts('{{path('rh_salary_pay_slip_cancel', {'id': salary_pay_slip.id })}}')"><i class="fa fa-times"></i></a>
{% endif %}
</td>
</tr>
{% endfor %}
<tr>
<td><input type="checkbox"></td>
<td><b>{{ count + 1 }}</b></td>
<td></td>
<td class="text-center"><b>{{ based|number_format(0, ',', ' ') }}</b></td>
<td class="text-center"><b>{{ grossTotal|number_format(0, ',', ' ') }}</b></td>
<td class="text-center"><b>{{ taxGross|number_format(0, ',', ' ') }}</b></td>
<td class="text-center"><b>{{ socialGross|number_format(0, ',', ' ') }}</b></td>
<td class="text-center"><b>{{ withholdingTax|number_format(0, ',', ' ') }}</b></td>
<td class="text-center"><b>{{ netSalary|number_format(0, ',', ' ') }}</b></td>
<td class="text-center"></td>
<td class="last text-center"></td>
</tr>
</tbody>
</table>
</div>