forked from seb_vallee/BillManager
96 lines
3.5 KiB
HTML
96 lines
3.5 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Devis {{ devis.numero }}{% endblock %}
|
|
{% block content %}
|
|
<div class="page-header">
|
|
<h1>Devis {{ devis.numero }}</h1>
|
|
<div class="btn-group">
|
|
<a href="/devis/" class="btn">← Retour</a>
|
|
<a href="/devis/{{ devis.id }}/pdf" class="btn btn-primary">⬇ Télécharger PDF</a>
|
|
{% if devis.statut.value == 'brouillon' %}
|
|
<a href="/devis/{{ devis.id }}/modifier" class="btn">Modifier</a>
|
|
{% endif %}
|
|
{% if devis.statut.value in ['envoye', 'accepte'] %}
|
|
<form method="post" action="/devis/{{ devis.id }}/convertir" style="display:inline">
|
|
<button type="submit" class="btn btn-primary"
|
|
onclick="return confirm('Convertir ce devis en facture ?')">
|
|
→ Convertir en facture
|
|
</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="detail-card">
|
|
<div class="detail-meta">
|
|
<div>
|
|
<label>Client</label>
|
|
<strong>{{ devis.client.nom }}</strong><br>
|
|
{{ devis.client.adresse }}<br>
|
|
{{ devis.client.code_postal }} {{ devis.client.ville }}
|
|
</div>
|
|
<div>
|
|
<label>Dates</label>
|
|
Émission : {{ devis.date_emission | date_fr }}<br>
|
|
Validité : {{ devis.date_validite | date_fr }}
|
|
</div>
|
|
<div>
|
|
<label>Statut</label>
|
|
<span class="badge badge-{{ devis.statut.value }}">{{ devis.statut.value }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Description</th>
|
|
<th>Qté</th>
|
|
<th>PU HT</th>
|
|
<th>Total HT</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for l in devis.lignes %}
|
|
<tr>
|
|
<td>{{ l.description }}</td>
|
|
<td>{{ l.quantite | int if l.quantite == l.quantite | int else l.quantite }}</td>
|
|
<td>{{ l.prix_unitaire_ht | montant }}</td>
|
|
<td>{{ l.total_ht | montant }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<td colspan="3"><strong>Total HT</strong></td>
|
|
<td><strong>{{ devis.total_ht | montant }}</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" class="tva-mention">TVA non applicable — art. 293B du CGI</td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
|
|
{% if devis.notes %}
|
|
<p><strong>Notes :</strong> {{ devis.notes }}</p>
|
|
{% endif %}
|
|
{% if devis.conditions %}
|
|
<p><strong>Conditions :</strong> {{ devis.conditions }}</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="form-card">
|
|
<h2>Changer le statut</h2>
|
|
<form method="post" action="/devis/{{ devis.id }}/statut" style="display:flex; gap:1rem; align-items:flex-end;">
|
|
<div class="form-group">
|
|
<label>Nouveau statut</label>
|
|
<select name="statut">
|
|
<option value="brouillon" {% if devis.statut.value == 'brouillon' %}selected{% endif %}>Brouillon</option>
|
|
<option value="envoye" {% if devis.statut.value == 'envoye' %}selected{% endif %}>Envoyé</option>
|
|
<option value="accepte" {% if devis.statut.value == 'accepte' %}selected{% endif %}>Accepté</option>
|
|
<option value="refuse" {% if devis.statut.value == 'refuse' %}selected{% endif %}>Refusé</option>
|
|
</select>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">Mettre à jour</button>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|