✨ feat(etl): implémente la finalisation et la signature électronique de l'état des lieux
This commit is contained in:
@@ -609,5 +609,56 @@
|
||||
{{ form_end(formBlocked) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# 09. POINTS DE CONTRÔLE #}
|
||||
{% if is_edit is defined and is_edit %}
|
||||
<div class="backdrop-blur-xl bg-[#1e293b]/40 border border-white/5 rounded-[2.5rem] p-8 shadow-2xl mt-8">
|
||||
<h3 class="text-lg font-bold text-white mb-6 flex items-center">
|
||||
<span class="w-8 h-8 bg-teal-600/20 text-teal-500 rounded-lg flex items-center justify-center mr-3 text-[10px] font-black">09</span>
|
||||
Points de Contrôle (Entretien)
|
||||
</h3>
|
||||
|
||||
<div class="space-y-3 mb-8">
|
||||
{% for point in product.productPointControlls %}
|
||||
<div class="flex items-center justify-between p-4 bg-white/5 border border-white/5 rounded-2xl group hover:bg-white/10 transition-all">
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="w-8 h-8 bg-teal-500/20 text-teal-500 rounded-lg flex items-center justify-center">
|
||||
<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="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
|
||||
</div>
|
||||
<span class="text-sm font-bold text-white">{{ point.name }}</span>
|
||||
</div>
|
||||
|
||||
<form data-turbo="false" method="post" action="{{ path('app_crm_product_edit', {'id': product.id, act:'deletePoint', idPoint: point.id}) }}"
|
||||
onsubmit="return confirm('Supprimer ce point de contrôle ?');" class="inline-block">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ point.id) }}">
|
||||
<button type="submit" class="p-2 text-slate-400 hover:text-rose-500 transition-colors" title="Supprimer">
|
||||
<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="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/></svg>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="py-8 text-center border-2 border-dashed border-white/5 rounded-3xl">
|
||||
<p class="text-[10px] font-black text-slate-600 uppercase tracking-[0.2em]">Aucun point de contrôle défini</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="h-px bg-white/5 w-full mb-8"></div>
|
||||
|
||||
<form data-turbo="false" method="post" action="{{ path('app_crm_product_edit', {id: product.id, act: 'addPoint'}) }}" class="flex gap-4">
|
||||
<div class="flex-1">
|
||||
<label class="text-[10px] font-black text-slate-300 uppercase tracking-widest ml-1 mb-2 block">Nouveau point de contrôle</label>
|
||||
<input type="text" name="name" placeholder="Ex: Vérification des coutures"
|
||||
class="w-full bg-slate-900/50 border-white/5 rounded-2xl text-white focus:ring-teal-500/20 focus:border-teal-500 transition-all py-4 px-5 font-bold text-sm" required>
|
||||
</div>
|
||||
<div class="flex items-end">
|
||||
<button type="submit" class="h-[58px] px-8 bg-teal-600/10 hover:bg-teal-600 text-teal-500 hover:text-white text-[10px] font-black uppercase tracking-widest rounded-2xl transition-all border border-teal-500/20 flex items-center">
|
||||
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M12 4v16m8-8H4"/></svg>
|
||||
Ajouter
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
72
templates/etl/signed_entry_state.twig
Normal file
72
templates/etl/signed_entry_state.twig
Normal file
@@ -0,0 +1,72 @@
|
||||
{% extends 'etl/base.twig' %}
|
||||
|
||||
{% block title %}Signature EDL - #{{ mission.numReservation }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500">
|
||||
|
||||
{# HEADER #}
|
||||
<div class="flex items-center gap-4">
|
||||
<a href="{{ path('etl_contrat_view', {id: mission.id}) }}" 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">
|
||||
<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 19l-7-7 7-7" /></svg>
|
||||
</a>
|
||||
<div>
|
||||
<h1 class="text-xl font-black text-slate-900 tracking-tight">Signature</h1>
|
||||
<p class="text-[10px] font-bold text-slate-400 uppercase tracking-widest">Réf: #{{ mission.numReservation }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-blue-600 rounded-[2rem] p-8 text-white shadow-xl shadow-blue-600/20 text-center relative overflow-hidden">
|
||||
<div class="absolute top-0 right-0 -mr-8 -mt-8 w-32 h-32 bg-white/10 rounded-full blur-2xl"></div>
|
||||
<h2 class="text-2xl font-black mb-2">État des Lieux Terminé</h2>
|
||||
<p class="text-sm font-medium opacity-90">Veuillez procéder à la signature du document.</p>
|
||||
</div>
|
||||
|
||||
{# ACTIONS SIGNATURE #}
|
||||
<div class="space-y-4">
|
||||
<div class="p-6 bg-white rounded-[2rem] border border-slate-100 shadow-sm">
|
||||
<h3 class="text-xs font-black text-slate-400 uppercase tracking-widest mb-4">Signatures Requises</h3>
|
||||
|
||||
<div class="space-y-3">
|
||||
{% if providerSigned %}
|
||||
<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">
|
||||
<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>
|
||||
Signé (Prestataire)
|
||||
</div>
|
||||
{% else %}
|
||||
<a href="{{ path('etl_sign_provider', {id: etatLieux.id}) }}" class="w-full py-4 bg-slate-900 text-white rounded-2xl font-black uppercase text-sm tracking-widest shadow-lg hover:bg-slate-800 transition-all 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="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" /></svg>
|
||||
Signer (Prestataire)
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if customerSigned %}
|
||||
<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">
|
||||
<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>
|
||||
Signé (Client)
|
||||
</div>
|
||||
{% else %}
|
||||
<a href="{{ path('etl_sign_customer', {id: etatLieux.id}) }}" class="w-full py-4 bg-white border-2 border-slate-200 text-slate-900 rounded-2xl font-black uppercase text-sm tracking-widest hover:border-slate-900 hover:bg-slate-50 transition-all 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="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" /></svg>
|
||||
Faire Signer (Client)
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if providerSigned and customerSigned %}
|
||||
<form action="{{ path('etl_edl_close', {id: mission.id}) }}" method="post">
|
||||
<button type="submit" class="w-full py-4 bg-blue-600 hover:bg-blue-700 text-white rounded-2xl font-black uppercase text-sm tracking-widest shadow-lg shadow-blue-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 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
|
||||
Clôturer l'état des lieux
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<a href="{{ path('etl_contrat_view', {id: mission.id}) }}" class="text-xs font-bold text-slate-400 hover:text-blue-600 transition-colors">Retour à la mission</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -93,10 +93,14 @@
|
||||
<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 %}
|
||||
|
||||
{% 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 %}
|
||||
{# ACTION EDL #}
|
||||
{% if is_chorus or solde <= 0 %}
|
||||
<form action="{{ path('etl_mission_edl_start', {id: mission.id}) }}" method="post" class="mt-6">
|
||||
|
||||
46
templates/mails/etl/edl_confirmation.twig
Normal file
46
templates/mails/etl/edl_confirmation.twig
Normal file
@@ -0,0 +1,46 @@
|
||||
{% extends 'mails/base.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<mj-text>
|
||||
Bonjour,
|
||||
</mj-text>
|
||||
<mj-text>
|
||||
L'état des lieux d'installation pour la réservation <strong>#{{ datas.contrat.numReservation }}</strong> a été validé et signé par les deux parties.
|
||||
</mj-text>
|
||||
|
||||
<mj-text font-weight="bold" font-size="14px" padding-top="20px">
|
||||
Détails de l'intervention :
|
||||
</mj-text>
|
||||
<mj-text>
|
||||
Client : {{ datas.contrat.customer.surname }} {{ datas.contrat.customer.name }}<br>
|
||||
Lieu : {{ datas.contrat.addressEvent }} {{ datas.contrat.zipCodeEvent }} {{ datas.contrat.townEvent }}
|
||||
</mj-text>
|
||||
|
||||
{% if datas.etatLieux.comments|length > 0 %}
|
||||
<mj-text font-weight="bold" font-size="14px" padding-top="20px">
|
||||
Observations / Commentaires :
|
||||
</mj-text>
|
||||
{% for comment in datas.etatLieux.comments %}
|
||||
<mj-text padding-bottom="0">
|
||||
- [{{ comment.createdAt|date('d/m H:i') }}] {{ comment.content }}
|
||||
</mj-text>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if datas.etatLieux.files|length > 0 %}
|
||||
<mj-text font-weight="bold" font-size="14px" padding-top="20px">
|
||||
Médias joints au dossier ({{ datas.etatLieux.files|length }}) :
|
||||
</mj-text>
|
||||
{% for file in datas.etatLieux.files %}
|
||||
<mj-text padding-bottom="2px">
|
||||
- <a href="{{ system.path }}{{ vich_uploader_asset(file, 'file') }}" target="_blank" style="color:#3b82f6; text-decoration:underline;">
|
||||
Voir le fichier {{ loop.index }} ({{ file.type|capitalize }})
|
||||
</a>
|
||||
</mj-text>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<mj-text padding-top="20px" font-weight="bold">
|
||||
Votre état des lieux est présent en PJ.
|
||||
</mj-text>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user