Files
3d-pricing/templates/jobs.html
T

67 lines
2.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends 'base.html' %}
{% block title %}Commandes{% endblock %}
{% block content %}
<div class="page-header d-flex justify-content-between align-items-center">
<h1><i class="bi bi-printer me-2 text-primary"></i>Commandes</h1>
<div class="d-flex gap-2">
<a href="{{ url_for('export_csv') }}" class="btn btn-sm btn-outline-secondary">
<i class="bi bi-download me-1"></i>Export CSV
</a>
<a href="{{ url_for('new_job') }}" class="btn btn-sm" style="background:#ff6b35;color:#fff">
<i class="bi bi-plus-lg me-1"></i>Nouveau
</a>
</div>
</div>
<div class="card">
<div class="card-body p-0">
{% if jobs %}
<table class="table table-hover mb-0">
<thead class="table-light">
<tr>
<th>Date</th><th>Nom</th><th>Client</th><th>Poids</th>
<th>Durée</th><th>Design</th><th>Marge</th><th>Remise</th>
<th class="text-end">Prix final</th><th></th>
</tr>
</thead>
<tbody>
{% for j in jobs %}
<tr>
<td class="text-muted small">{{ j.created_at[:10] }}</td>
<td><a href="{{ url_for('job_detail', id=j.id) }}" class="text-decoration-none fw-semibold">{{ j.name }}</a></td>
<td>{{ j.client_name or '—' }}</td>
<td>{{ j.weight_g }} g</td>
<td>{{ j.print_time_s | fmt_time }}</td>
<td><span class="badge bg-light text-dark">×{{ j.design_multiplier }}</span></td>
<td><span class="badge bg-light text-dark">{{ j.gross_margin_pct }}%</span></td>
<td>
{% if j.discount_pct > 0 %}
<span class="badge bg-danger">-{{ j.discount_pct }}%</span>
{% else %}—{% endif %}
</td>
<td class="text-end fw-bold" style="color:#ff6b35">{{ j.final_price }} €</td>
<td>
<div class="d-flex gap-1">
<a href="{{ url_for('job_detail', id=j.id) }}" class="btn btn-sm btn-outline-secondary py-0"></a>
<form method="POST" action="{{ url_for('delete_job', id=j.id) }}"
onsubmit="return confirm('Supprimer ?')">
<button class="btn btn-sm btn-outline-danger py-0"><i class="bi bi-trash"></i></button>
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="text-center text-muted py-5">
<i class="bi bi-inbox fs-1"></i>
<p class="mt-2">Aucune commande enregistrée.</p>
<a href="{{ url_for('new_job') }}" class="btn btn-sm" style="background:#ff6b35;color:#fff">Créer le premier calcul</a>
</div>
{% endif %}
</div>
</div>
{% endblock %}