suivi/templates/admin/expense_report/_show.html.twig
2022-07-13 11:11:00 +02:00

124 lines
6.1 KiB
Twig

<div id="form-main">
<div class="tab-content">
<div class="tab-pane active">
<div class="tab-form p-0">
{% if entity.moves|length %}
<div class="table-responsive">
<table class="table mb-0">
<thead class="bg-light">
<tr>
<th width="120">Date</th>
<th>Évènement</th>
<th>Trajet</th>
<th width="120" class="text-right">Distance</th>
<th width="120">Aller-retour</th>
<th width="90" class="text-right">Péage(s)</th>
<th width="90" class="text-right">Parking(s)</th>
<th width="90" class="text-right">Montant&nbsp;TTC</th>
</tr>
</thead>
{% for item in entity.moves %}
<tr>
<td>
{{ item.date|date('d/m/Y') }}
</td>
<td>
{{ item.event }}
</td>
<td>
{{ item.addressFrom }}<br>
{{ item.addressTo }}
</td>
<td class="text-right">
{{ item.distance }}Km
</td>
<td>
{{ item.isRoundTrip ? 'oui' : 'non' }}
</td>
<td class="text-right">
{{ item.highwayPay > 0 ? (item.highwayPay|number_format(2, ',') ~ '€') : '-' }}
</td>
<td class="text-right">
{{ item.parkingPay > 0 ? (item.parkingPay|number_format(2, ',') ~ '€') : '-' }}
</td>
<td class="text-right">
{{ entity.totalAmount('move', item)|number_format(2, ',') }}
</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if entity.variousPayments|length %}
<div class="table-responsive">
<table class="table mb-0">
<thead class="bg-light">
<tr>
<th width="120">Date</th>
<th>Libellé</th>
<th width="90" class="text-right">Montant&nbsp;TTC</th>
</tr>
</thead>
{% for item in entity.variousPayments %}
<tr>
<td>
{{ item.date|date('d/m/Y') }}
</td>
<td>
{{ item.label }}
</td>
<td class="text-right">
{{ entity.totalAmount('various_payment', item)|number_format(2, ',') }}
</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
<div class="table-responsive">
<table class="table mb-0">
<tr>
<td>
{% if entity.bills|length %}
Facture(s)
{% endif %}
</td>
<td class="text-right"><span class="font-weight-bold mr-3">Total</span> {{ entity.totalAmount|number_format(2, ',') }}€</td>
</tr>
<tr>
<td>
{% for item in entity.bills %}
<div class="mb-1">
<a class="btn btn-light border" href="{{ asset(item) }}" target="_blank">{{ item|split('/')|last }}</a>
</div>
{% endfor %}
</td>
<td width="250" class="text-right">
Barème au kilomètre : {{ entity.scalePerKilometer|number_format(2, ',') }}
<br>
<br>
{% if entity.isPaid %}
{% if entity.paidAt %}
<span class="btn btn-success">Payée le {{ entity.paidAt|date('d/m/Y à H:i') }}</span>
{% else %}
<span class="btn btn-success">Payée</span>
{% endif %}
{% elseif entity.isRequestedPayment %}
<span class="btn btn-warning">En attente de paiement</span>
{% else %}
<span class="btn btn-light">Brouillon</span>
{% endif %}
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>