Browse Source

Creado índice con pestaña para cada vehículo

politica
Celestino Rey 1 year ago
parent
commit
589f3f4adb
1 changed files with 23 additions and 27 deletions
  1. +23
    -27
      RepostajesPy/servicios/repostajes/templates/index.html

+ 23
- 27
RepostajesPy/servicios/repostajes/templates/index.html View File

@ -10,9 +10,9 @@
<a class="flex-sm-fill text-sm-center nav-link active" id="orders-all-tab" data-bs-toggle="tab" href="#orders-all" role="tab" aria-controls="orders-all" aria-selected="true">Todos</a>
{% for cadacoche in vehiculos %}
<a class="flex-sm-fill text-sm-center nav-link" id="orders-paid-tab" data-bs-toggle="tab" href="#{{ cadacoche.matricula }}" role="tab" aria-controls="orders-paid" aria-selected="false">{{ cadacoche.marca }}</a>
<a class="flex-sm-fill text-sm-center nav-link" id="orders-paid-tab" data-bs-toggle="tab" href="#{{ cadacoche.matricula }}" role="tab" aria-controls="orders-paid" aria-selected="false">{{ cadacoche.marca }}</a>
{% endfor %}
{% endfor %}
<a class="flex-sm-fill text-sm-center nav-link" id="orders-pending-tab" data-bs-toggle="tab" href="#vehiculos" role="tab" aria-controls="orders-pending" aria-selected="false">Vehículos</a>
@ -28,13 +28,13 @@
<thead>
<tr>
<th class="cell">#</th>
<th class="cell">Fecha</th>
<th class="cell">Vehículo</th>
<th class="cell">Kilómetros</th>
<th class="cell">Litros</th>
<th class="cell">Descuento</th>
<th class="cell">Precio/litro</th>
<th class="cell">Importe</th>
<th class="cell">Fecha</th>
<th class="cell">Vehículo</th>
<th class="cell">Kilómetros</th>
<th class="cell">Litros</th>
<th class="cell">Descuento</th>
<th class="cell">Precio/litro</th>
<th class="cell">Importe</th>
</tr>
</thead>
<tbody>
@ -52,8 +52,7 @@
{% endfor %}
</tbody>
</table>
</div><!--//table-responsive-->
</div><!--//table-responsive-->
</div><!--//app-card-body-->
</div><!--//app-card-->
</div><!--//tab-pane-->
@ -67,7 +66,6 @@
<table class="table mb-0 text-left">
<thead>
<tr>
<th class="cell">Matrícula</th>
<th class="cell">#</th>
<th class="cell">Fecha</th>
<th class="cell">Vehículo</th>
@ -76,32 +74,30 @@
<th class="cell">Descuento</th>
<th class="cell">Precio/litro</th>
<th class="cell">Importe</th>
<!--
<th class="cell">Recorridos</th>
<th class="cell">Consumo/100kms</th>
-->
</tr>
</thead>
<tbody>
{% for repostaje in repostajes %}
<!-- {% if micoche.id == repostajes.vehiculo_id %}-->
{% if repostaje.vehiculo_id == micoche.id %}
<tr>
<td>{{ micoche.matricula }} </td>
<td class="cell">{{ repostaje.id }}</td>
<td class="cell">{{ repostaje.fecha }}</td>
<td class="cell">{{ repostaje.vehiculo }}</td>
<td style="text-align: right" class="cell">{{ repostaje.kms }}</td>
<td style="text-align: right" class="cell">{{ repostaje.litros }}</td>
<td style="text-align: right" class="cell">{{ repostaje.descuento }}</td>
<td style="text-align: right" class="cell">{{ repostaje.precioxlitro }}</td>
<td style="text-align: right" class="cell">{{ repostaje.importe }}</td>
<td style="text-align: right" class="cell">{{ repostaje.kmsrecorridos }} </td>
<td class="cell">0</td>
<td class="cell">{{ repostaje.vehiculos.matricula }}</td>
<td style="text-align: right" class="cell">{{ "%.0f"|format(repostaje.kms) }}</td>
<td style="text-align: right" class="cell">{{ "%.2f €"|format(repostaje.litros) }}</td>
<td style="text-align: right" class="cell">{{ "%.2f €"|format(repostaje.descuento) }}</td>
<td style="text-align: right" class="cell">{{ "%.2f €"|format(repostaje.precioxlitro) }}</td>
<td style="text-align: right" class="cell">{{ "%.2f €"|format(repostaje.importe) }}</td>
</tr>
<!--{% endif %} -->
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table>


Loading…
Cancel
Save