feat(etl/mission): Implémente la gestion des missions avec dashboard, liste et démarrage

This commit is contained in:
Serreau Jovann
2026-02-06 13:46:35 +01:00
parent d92642d1d7
commit 3494d627dc
17 changed files with 1564 additions and 11 deletions

View File

@@ -4,7 +4,7 @@
{% block body %}
<div class="space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500">
{# HEADER #}
<div class="flex items-center gap-4">
<a href="{{ path('etl_home') }}" class="w-10 h-10 bg-white rounded-xl border border-slate-100 flex items-center justify-center text-slate-400 hover:text-blue-600 transition-all shadow-sm">
@@ -25,13 +25,93 @@
</button>
</form>
{% elseif mission.etatLieux.status == 'delivery_progress' %}
<div class="w-full py-4 bg-amber-500/10 border border-amber-500/20 text-amber-500 rounded-2xl font-black uppercase text-sm tracking-widest flex items-center justify-center gap-3">
<span class="relative flex h-3 w-3">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-amber-400 opacity-75"></span>
<span class="relative inline-flex rounded-full h-3 w-3 bg-amber-500"></span>
</span>
Livraison en cours
<form action="{{ path('etl_mission_finish', {id: mission.id}) }}" method="post">
<button type="submit" class="w-full py-4 bg-amber-500 hover:bg-amber-600 text-white rounded-2xl font-black uppercase text-sm tracking-widest shadow-lg shadow-amber-500/30 transition-all active:scale-95 flex items-center justify-center gap-3">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg>
Confirmer la livraison
</button>
</form>
{% elseif mission.etatLieux.status == 'delivery_done' %}
<div class="w-full py-4 bg-emerald-500/10 border border-emerald-500/20 text-emerald-600 rounded-2xl font-black uppercase text-sm tracking-widest flex items-center justify-center gap-3 mb-6">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
Livraison Terminée
</div>
{% set is_chorus = (mission.devis and 'Chorus' in mission.devis.paymentMethod) %}
{% if not is_chorus %}
{# CAUTION #}
<div class="bg-white rounded-[2rem] p-6 border border-slate-100 shadow-sm mb-4">
<h3 class="text-xs font-black text-slate-400 uppercase tracking-widest mb-4">Caution</h3>
<div class="flex items-center justify-between">
<span class="text-2xl font-black text-slate-900">{{ totalCaution|number_format(2, ',', ' ') }}€</span>
{% if cautionPaid %}
<span class="px-3 py-1 bg-emerald-100 text-emerald-600 rounded-lg text-[10px] font-black uppercase">Reçue</span>
{% else %}
<form action="{{ path('etl_mission_caution', {id: mission.id}) }}" method="post">
<button type="submit" class="px-4 py-2 bg-slate-900 text-white rounded-xl text-[10px] font-black uppercase tracking-wide hover:bg-blue-600 transition-colors">
Valider Réception
</button>
</form>
{% endif %}
</div>
</div>
{# SOLDE #}
{% if solde > 0 %}
<div class="bg-slate-900 rounded-[2rem] p-6 text-white shadow-xl mb-4">
<div class="flex justify-between items-start mb-4">
<div>
<p class="text-[10px] font-black text-blue-400 uppercase tracking-widest mb-1">Reste à payer</p>
<p class="text-3xl font-black">{{ solde|number_format(2, ',', ' ') }}€</p>
</div>
</div>
{# Paiement en ligne #}
<form action="{{ path('elt_mission_confirme', {id: mission.id}) }}" method="post" class="mb-4">
<button type="submit" class="w-full py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-xl font-bold text-xs uppercase tracking-wider shadow-lg shadow-blue-900/50 transition-all active:scale-95 flex items-center justify-center gap-2">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"/></svg>
Paiement Carte Bancaire
</button>
</form>
{# Paiements Manuels #}
<p class="text-[9px] font-bold text-slate-500 uppercase tracking-widest mb-2 text-center">Encaissement direct</p>
<div class="grid grid-cols-3 gap-2">
{% for method in ['Chèque', 'Espèces', 'Autre'] %}
<form action="{{ path('etl_mission_manual_pay', {id: mission.id}) }}" method="post">
<input type="hidden" name="method" value="{{ method }}">
<button type="submit" class="w-full py-2 bg-slate-800 hover:bg-slate-700 text-slate-300 hover:text-white rounded-xl font-bold text-[10px] uppercase tracking-wide transition-all active:scale-95 border border-slate-700">
{{ method }}
</button>
</form>
{% endfor %}
</div>
</div>
{% else %}
<div class="bg-emerald-500/10 border border-emerald-500/20 text-emerald-500 rounded-[2rem] p-6 text-center mb-4">
<p class="text-xs font-black uppercase tracking-widest">Solde Réglé</p>
</div>
{% endif %}
{% endif %}
{# ACTION EDL #}
{% if is_chorus or solde <= 0 %}
<form action="{{ path('etl_mission_edl_start', {id: mission.id}) }}" method="post" class="mt-6">
<button type="submit" class="w-full py-4 bg-indigo-600 hover:bg-indigo-500 text-white rounded-2xl font-black uppercase text-sm tracking-widest shadow-lg shadow-indigo-600/30 transition-all active:scale-95 flex items-center justify-center gap-3">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" /></svg>
Commencer l'état des lieux
</button>
</form>
{% endif %}
{% elseif mission.etatLieux.status == 'edl_progress' %}
<a href="{{ path('etl_mission_edl', {id: mission.id}) }}" class="w-full py-4 bg-indigo-600 hover:bg-indigo-500 text-white rounded-2xl font-black uppercase text-sm tracking-widest shadow-lg shadow-indigo-600/30 transition-all active:scale-95 flex items-center justify-center gap-3 mb-6">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /></svg>
Reprendre l'état des lieux
</a>
{% endif %}
{# DATES #}
@@ -68,7 +148,7 @@
{# ADRESSE & GPS #}
<div class="bg-white rounded-[2rem] p-6 border border-slate-100 shadow-sm">
<h3 class="text-xs font-black text-slate-400 uppercase tracking-widest mb-4">Lieu de l'événement</h3>
<div class="mb-6">
<p class="font-bold text-slate-900 text-sm leading-relaxed">
{{ mission.addressEvent }}<br>
@@ -92,7 +172,7 @@
{# PRODUCTS & OPTIONS #}
<div class="bg-white rounded-[2rem] p-6 border border-slate-100 shadow-sm">
<h3 class="text-xs font-black text-slate-400 uppercase tracking-widest mb-4">Matériel & Options</h3>
<div class="space-y-3">
{% for line in mission.contratsLines %}
{% if 'livraison' not in line.name|lower %}
@@ -127,7 +207,7 @@
{% endfor %}
</div>
</div>
{# DETAILS / NOTES #}
{% if mission.details or mission.notes %}
<div class="bg-white rounded-[2rem] p-6 border border-slate-100 shadow-sm">