<div class="modal" role="dialog" id="encaissement">
<div class="modal-dialog" role="document" style=" width: 900px;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Encaisser factures</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div>
{% if company is not defined or not company %}
<div style="color:red">Veuillez selectionner une societé</div>
{% endif %}
</div>
<form name="form-encaissement" method="POST">
<div>
<div style="padding-top: 20px">Mode de règlement</div>
<select name="payment-method" class="form-control">
<option value="cheque">Chèque</option>
<option value="CV">CB</option>
<option value="especes">Espèces</option>
<option value="virement">Virement</option>
</select>
</div>
<div style="padding-top: 20px">
Réference de règlement
<input type="text" class="form-control" name="reference"/>
</div>
<div style="padding-top: 20px">
Date réglement
<input type="date" name="date" value="{{ "now"|date("Y-m-d") }}">
</div>
<table class="table table-hover" id="sample-table-1">
<thead>
<tr>
<th> <div>
<input type="checkbox" class="encaissement-all">
</div></th>
<th>Numéro facture</th>
<th>Société</th>
<th>Date</th>
<th>Nom du client</th>
<th>Solde</th>
<th>Montant règlement</th>
</tr>
</thead>
<tbody>
{% for billing in billingsEncaissement %}
{% if billing.solde and billing.solde > 0 %}
<tr>
<td>
<input type="checkbox" class="encaissement-checkbox" name="encaissement[{{ billing.id }}][value]" data-solde="{{ billing.solde }}">
</td>
<td>{{ billing.code }}</td>
<td>{{ billing.company }}</td>
<td>{{ billing.dateBilling|date('d/m/Y') }}</td>
<td>
{% if billing.client %}
{{ billing.client.firstname }} {{ billing.client.lastname }}
{% endif %}
</td>
<td class="soldes" data-solde="{{ billing.solde }}"> {{ billing.solde }}</td>
<td>
<input type="text" name="encaissement[{{ billing.id }}][solde]" value="{{ billing.solde }}" style="text-align: right">
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
TOTAL : <span class="total"></span> €
<input type="hidden" name="company" value="{% if company and company is defined %}{{ company.id }}{% endif %}">
<div class="text-center">
<button type="submit" class="btn btn-primary">Encaisser</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
</div>
</form>
</div>
</div>
</div>
</div>