add webhooks for refused signature contrat

This commit is contained in:
Serreau Jovann
2026-02-16 09:09:05 +01:00
parent f074638719
commit 59f897f955
5 changed files with 191 additions and 99 deletions

2
.env
View File

@@ -85,7 +85,7 @@ STRIPE_WEBHOOKS_SECRET=
SIGN_URL=https://00ca-212-114-31-239.ngrok-free.app
STRIPE_BASEURL=https://00ca-212-114-31-239.ngrok-free.app
CONTRAT_BASEURL=https://00ca-212-114-31-239.ngrok-free.app
CONTRAT_BASEURL=https://esyweb.local
MINIO_S3_URL=
MINIO_S3_CLIENT_ID=

View File

@@ -189,6 +189,46 @@ class Webhooks extends AbstractController
$metadata = $content->metadata;
$status = $content->status ?? '';
// Email de notification admin (à adapter si besoin)
$adminEmail = 'contact@ludikevent.fr';
// --- TRAITEMENT DES CONTRATS ---
if (isset($metadata->type) && $metadata->type === "contrat" && isset($metadata->id)) {
$contrats = $contratsRepository->find($metadata->id);
if ($contrats instanceof Contrats) {
// Cas 1 : Signature refusée par le client
if ($status === "declined") {
$reason = $content->decline_reason ?? 'Aucune raison spécifiée';
$contrats->setRefused(true);
$contrats->setRefusedRaison($reason);
$entityManager->persist($contrats);
$entityManager->flush();
// Notification ADMIN
$customer = $contrats->getCustomer();
if ($customer) {
$mailer->send(
$adminEmail,
"Intranet Ludikevent",
"[Action Requise] Refus de signature - Contrat n°" . $contrats->getNumReservation(),
"mails/customer/contrat_refuses.twig",
[
'contrat' => $contrats,
'raison' => $reason,
]
);
}
$appLogger->record('WEBHOOK', sprintf("Contrat %s refusé par le client. Raison: %s", $contrats->getNumReservation(), $reason));
return new Response("ok-contrat-declined");
}
}
}
// --- TRAITEMENT DES DEVIS ---
if (isset($metadata->type) && $metadata->type === "devis" && isset($metadata->id)) {
$devis = $devisRepository->find($metadata->id);
@@ -204,13 +244,13 @@ class Webhooks extends AbstractController
$entityManager->persist($devis);
$entityManager->flush();
// Notification au client (Confirmation de prise en compte du refus)
// Notification ADMIN
$customer = $devis->getCustomer();
if ($customer) {
$mailer->send(
$customer->getEmail(),
$customer->getName() . " " . $customer->getSurname(),
"[Intranet Ludikevent] - Le client a refusé la signature du devis n°" . $devis->getNum(),
$adminEmail,
"Intranet Ludikevent",
"[Action Requise] Refus de signature - Devis n°" . $devis->getNum(),
"mails/customer/devis_refuses.twig",
[
'devis' => $devis,
@@ -224,9 +264,8 @@ class Webhooks extends AbstractController
return new Response("ok-devis-declined");
}
// Cas 2 : Signature complétée (Optionnel - à implémenter selon vos besoins)
// Cas 2 : Signature complétée
if ($status === "completed") {
// Logique de succès (ex: passage en contrat)
$appLogger->record('WEBHOOK', sprintf("Devis %s signé avec succès.", $devis->getNum()));
return new Response("ok-devis-completed");
}

View File

@@ -152,6 +152,12 @@ class Contrats
#[ORM\ManyToOne(inversedBy: 'contrats')]
private ?Prestaire $prestataire = null;
#[ORM\Column(nullable: true)]
private ?bool $refused = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $refusedRaison = null;
public function __construct()
{
$this->contratsPayments = new ArrayCollection();
@@ -904,4 +910,28 @@ class Contrats
})->first() instanceof ContratsPayments;
}
public function isRefused(): ?bool
{
return $this->refused;
}
public function setRefused(?bool $refused): static
{
$this->refused = $refused;
return $this;
}
public function getRefusedRaison(): ?string
{
return $this->refusedRaison;
}
public function setRefusedRaison(?string $refusedRaison): static
{
$this->refusedRaison = $refusedRaison;
return $this;
}
}

View File

@@ -5,7 +5,7 @@
{% block actions %}
<div class="flex items-center space-x-3">
<a data-turbo="false" href="{{ path('app_crm_devis_add') }}" class="flex items-center space-x-2 px-6 py-3 bg-blue-600 hover:bg-blue-500 text-white text-[10px] font-black uppercase tracking-[0.2em] rounded-xl transition-all shadow-lg shadow-blue-600/20 group">
<a data-turbo="false" href="{{ path('app_crm_devis_add') }}" class="flex items-center space-x-2 px-6 py-3 bg-blue-600 hover:bg-blue-500 text-white text-[10px] font-black uppercase tracking-[0.2em] rounded-xl transition-all shadow-lg shadow-blue-600/20 group">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M12 4v16m8-8H4" />
</svg>
@@ -31,34 +31,41 @@
</thead>
<tbody class="divide-y divide-white/5">
{% for quote in quotes %}
{# LOGIQUE STATUT : On sépare le statut de la raison (ex: refused|Trop cher) #}
{% set stateParts = quote.state|split('|') %}
{% set status = stateParts[0] %}
{% set reason = stateParts[1] ?? null %}
<tr class="group hover:bg-white/[0.02] transition-colors">
{# RÉFÉRENCE #}
<td class="px-6 py-4">
<div class="flex flex-col">
<span class="text-[11px] font-mono font-bold text-blue-500 tracking-wider">
{{ quote.ref|default('DEV-' ~ quote.id|upper) }}
</span>
<span class="text-[8px] text-slate-600 font-bold uppercase tracking-widest mt-0.5">ID: #{{ quote.id }}</span>
<span class="text-[11px] font-mono font-bold text-blue-500 tracking-wider">
{{ quote.ref|default('DEV-' ~ quote.id|upper) }}
</span>
<span class="text-[8px] text-slate-600 font-bold uppercase tracking-widest mt-0.5">
{{ quote.num }}
</span>
</div>
</td>
{# CLIENT #}
<td class="px-6 py-4">
<div class="flex flex-col">
<span class="text-sm font-bold text-white group-hover:text-blue-400 transition-colors capitalize">
{{ quote.customer.surname|upper }} {{ quote.customer.name }}
</span>
<span class="text-sm font-bold text-white group-hover:text-blue-400 transition-colors capitalize">
{{ quote.customer.surname|upper }} {{ quote.customer.name }}
</span>
<span class="text-[9px] text-slate-300 font-bold uppercase tracking-tighter italic">
{{ quote.customer.phone|default(quote.customer.email) }}
</span>
{{ quote.customer.phone|default(quote.customer.email) }}
</span>
</div>
</td>
{# DATE #}
<td class="px-6 py-4">
<span class="text-xs text-slate-400 font-medium">
{{ quote.createa|date('d/m/Y') }}
</span>
<span class="text-xs text-slate-400 font-medium">
{{ quote.createa|date('d/m/Y') }}
</span>
</td>
{# STATUT DYNAMIQUE #}
@@ -66,7 +73,8 @@
{% set statusClasses = {
'draft': 'text-slate-400 bg-slate-500/10 border-slate-500/20',
'created_waitsign': 'text-amber-400 bg-amber-500/10 border-amber-500/20',
'refusée': 'text-rose-400 bg-rose-500/10 border-rose-500/20',
'wait-send': 'text-amber-400 bg-amber-500/10 border-amber-500/20',
'refused': 'text-rose-400 bg-rose-500/10 border-rose-500/20',
'signed': 'text-emerald-400 bg-emerald-500/10 border-emerald-500/20',
'signée': 'text-emerald-400 bg-emerald-500/10 border-emerald-500/20'
} %}
@@ -74,21 +82,34 @@
{% set statusLabels = {
'draft': 'Brouillon',
'created_waitsign': 'Attente Signature',
'refusée': 'Refusé',
'wait-send': 'Envoi en cours',
'refused': 'Refusé',
'signed': 'Signé',
'signée': 'Signé'
} %}
{% set currentStatus = quote.state|lower %}
<span class="px-3 py-1.5 rounded-lg border text-[8px] font-black uppercase tracking-[0.15em] whitespace-nowrap {{ statusClasses[currentStatus] ?? 'text-slate-400 bg-slate-500/10 border-slate-500/20' }}">
{% if currentStatus == 'created_waitsign' %}
<div class="flex flex-col items-start gap-1">
<span class="px-3 py-1.5 rounded-lg border text-[8px] font-black uppercase tracking-[0.15em] whitespace-nowrap {{ statusClasses[status] ?? 'text-slate-400 bg-slate-500/10 border-slate-500/20' }}">
{% if status == 'created_waitsign' or status == 'wait-send' %}
<span class="inline-block w-1.5 h-1.5 rounded-full bg-amber-500 mr-1.5 animate-pulse"></span>
{% elseif currentStatus == 'signed' or currentStatus == 'signée' %}
{% elseif status == 'signed' or status == 'signée' %}
<span class="inline-block w-1.5 h-1.5 rounded-full bg-emerald-500 mr-1.5 shadow-[0_0_5px_#10b981]"></span>
{% elseif status == 'refused' %}
<span class="inline-block w-1.5 h-1.5 rounded-full bg-rose-500 mr-1.5"></span>
{% endif %}
{{ statusLabels[currentStatus] ?? currentStatus }}
</span>
{{ statusLabels[status] ?? status }}
</span>
{# AFFICHAGE RAISON REFUS #}
{% if status == 'refused' and reason %}
<div class="flex items-start gap-1.5 mt-1 px-1 max-w-[150px]">
<svg class="w-3 h-3 text-rose-500 mt-0.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
</svg>
<p class="text-[9px] font-medium text-rose-400 italic leading-tight">{{ reason }}</p>
</div>
{% endif %}
</div>
</td>
{# MONTANT #}
@@ -109,12 +130,6 @@
{{ (quote|totalQuotoHT)|number_format(2, ',', ' ') }}
</span>
{% endif %}
{% if quote.formule %}
<span class="text-[9px] text-blue-400 font-bold uppercase tracking-widest mt-1">
{{ quote.formule.name }}
</span>
{% endif %}
</div>
</td>
@@ -129,9 +144,9 @@
<td class="px-6 py-4 text-right">
<div class="flex items-center justify-end space-x-2">
{# Renvoyer lien de signature #}
{% if quote.state == "created_waitsign" or quote.state == "wait-send" %}
<a data-turbo="false" href="{{ path('app_crm_devis', {resend: quote.id}) }}"
{# Renvoyer lien de signature (Autorisé aussi si refusé pour relancer) #}
{% if status == "created_waitsign" or status == "wait-send" %}
<a data-turbo="false" href="{{ path('app_crm_devis', {resend: quote.id}) }}"
title="Renvoyer le lien de signature"
class="p-2 bg-indigo-600/10 hover:bg-indigo-600 text-indigo-500 hover:text-white rounded-xl transition-all border border-indigo-500/20 shadow-lg shadow-indigo-600/5">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -140,71 +155,65 @@
</a>
{% endif %}
{# Modifier : Interdit si signé #}
{% if quote.state != "signed" and quote.state != "signée" %}
<a data-turbo="false" href="{{ path('app_crm_devis_edit', {id: quote.id}) }}" class="p-2 bg-blue-600/10 hover:bg-blue-600 text-blue-500 hover:text-white rounded-xl transition-all border border-blue-500/20 shadow-lg shadow-blue-600/5">
{# Modifier : Interdit uniquement si signé #}
{% if status != "signed" and status != "refused" %}
<a data-turbo="false" href="{{ path('app_crm_devis_edit', {id: quote.id}) }}"
title="Modifier le devis"
class="p-2 bg-blue-600/10 hover:bg-blue-600 text-blue-500 hover:text-white rounded-xl transition-all border border-blue-500/20 shadow-lg shadow-blue-600/5">
<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="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>
</a>
{% endif %}
{# PDF Conditionnel #}
{% if quote.state == "signed" or quote.state == "signée" %}
{% if status == "signed" or status == "signée" %}
{# PDF Signé #}
<a download="SIGN_{{ quote.num }}.pdf" href="{{ vich_uploader_asset(quote, 'devisSignFile') }}" title="Télécharger le devis signé" target="_blank" class="p-2 bg-emerald-600/10 hover:bg-emerald-600 text-emerald-500 hover:text-white rounded-xl transition-all border border-emerald-500/20 shadow-lg shadow-emerald-600/5">
<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-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" /></svg>
</a>
{# Certificat Audit #}
<a download="AUDIT_{{ quote.num }}.pdf" href="{{ vich_uploader_asset(quote, 'devisAuditFile') }}" title="Télécharger le certificat d'audit" target="_blank" class="p-2 bg-purple-600/10 hover:bg-purple-600 text-purple-500 hover:text-white rounded-xl transition-all border border-purple-500/20 shadow-lg shadow-purple-600/5">
<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>
</a>
{% if quote.contrats is null %}
{# ÉTAT : AUCUN CONTRAT - BOUTON CRÉATION (BLEU) #}
{# ÉTAT : AUCUN CONTRAT #}
<a data-turbo="false" href="{{ path('app_crm_contrats_create', {idDevis: quote.id}) }}"
title="Générer le contrat de location"
title="Générer le contrat"
class="group flex items-center gap-2 px-5 py-2.5 bg-blue-600/10 hover:bg-blue-600 text-blue-500 hover:text-white rounded-xl transition-all duration-300 border border-blue-500/20 shadow-lg shadow-blue-600/5 font-bold text-[10px] uppercase tracking-widest">
<svg class="w-4 h-4 transition-transform group-hover:rotate-12" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
</svg>
<span>Créer le contrat</span>
<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="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>
<span>Contrat</span>
</a>
{% else %}
{# ÉTAT : CONTRAT EXISTANT - BOUTON ACCÈS (VERT) #}
{# ÉTAT : CONTRAT EXISTANT #}
<a data-turbo="false" href="{{ path('app_crm_contrats_view', {id: quote.contrats.id}) }}"
title="Accéder au contrat de location"
title="Voir le contrat"
class="group flex items-center gap-2 px-5 py-2.5 bg-emerald-500/10 hover:bg-emerald-500 text-emerald-500 hover:text-white rounded-xl transition-all duration-300 border border-emerald-500/20 shadow-lg shadow-emerald-600/5 font-bold text-[10px] uppercase tracking-widest">
<svg class="w-4 h-4 transition-transform group-hover:scale-110" 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 0" />
</svg>
<span>Voir le contrat</span>
<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 0" /></svg>
<span>Contrat</span>
</a>
{% endif %}
{% else %}
{# PDF Brouillon #}
<a download="{{ quote.num }}.pdf" href="{{ vich_uploader_asset(quote,'devisDocuSealFile') }}" target="_blank" class="p-2 bg-slate-600/10 hover:bg-slate-600text-slate-300 hover:text-white rounded-xl transition-all border border-slate-500/20">
{# PDF Brouillon / Attente #}
<a download="{{ quote.num }}.pdf" href="{{ vich_uploader_asset(quote,'devisDocuSealFile') }}" target="_blank" class="p-2 bg-slate-600/10 hover:bg-slate-600 text-slate-300 hover:text-white rounded-xl transition-all border border-slate-500/20">
<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="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z" /></svg>
</a>
{% endif %}
{# Delete : Interdit si signé #}
{% if quote.state != "signed" and quote.state != "signée" %}
{% if status != "signed" and status != "signée" %}
<a data-turbo="false" href="{{ path('app_crm_devis_delete', {id: quote.id}) }}?_token={{ csrf_token('delete' ~ quote.id) }}"
data-turbo-method="post"
data-turbo-confirm="Confirmer la suppression du devis {{ quote.num }} ?"
data-turbo-confirm="Confirmer la suppression ?"
class="p-2 bg-rose-500/10 hover:bg-rose-600 text-rose-500 hover:text-white rounded-xl transition-all border border-rose-500/20">
<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="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>
</a>
{% else %}
<div title="Un devis signé ne peut être supprimé" class="p-2 bg-slate-800/30 text-slate-600 rounded-xl border border-white/5 cursor-not-allowed">
<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="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" /></svg>
</div>
{% endif %}
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="6" class="py-24 text-center">
<p class="text-slate-500 italic uppercase tracking-[0.2em] text-[10px] font-black">Aucun devis trouvé</p>
<td colspan="7" class="py-24 text-center">
<div class="flex flex-col items-center justify-center opacity-50">
<svg class="w-12 h-12 text-slate-500 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>
<p class="text-slate-400 font-bold uppercase tracking-widest text-xs">Aucun devis trouvé</p>
</div>
</td>
</tr>
{% endfor %}
@@ -213,37 +222,6 @@
</div>
</div>
{# LÉGENDE #}
<div class="mt-6 p-4 rounded-2xl bg-[#1e293b]/40 border border-white/5 backdrop-blur-sm">
<p class="text-[10px] font-black text-slate-400 uppercase tracking-[0.2em] mb-3">Légende des actions</p>
<div class="flex flex-wrap gap-4 text-xs text-slate-300">
<div class="flex items-center gap-2">
<div class="p-1.5 bg-indigo-600/10 text-indigo-500 rounded-lg border border-indigo-500/20"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" /></svg></div>
<span>Renvoyer le lien</span>
</div>
<div class="flex items-center gap-2">
<div class="p-1.5 bg-blue-600/10 text-blue-500 rounded-lg border border-blue-500/20"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg></div>
<span>Modifier</span>
</div>
<div class="flex items-center gap-2">
<div class="p-1.5 bg-emerald-600/10 text-emerald-500 rounded-lg border border-emerald-500/20"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" /></svg></div>
<span>Télécharger Devis Signé</span>
</div>
<div class="flex items-center gap-2">
<div class="p-1.5 bg-purple-600/10 text-purple-500 rounded-lg border border-purple-500/20"><svg class="w-3 h-3" 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>Télécharger Certificat Audit</span>
</div>
<div class="flex items-center gap-2">
<div class="p-1.5 bg-slate-600/10 text-slate-300 rounded-lg border border-slate-500/20"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z" /></svg></div>
<span>Télécharger Devis PDF</span>
</div>
<div class="flex items-center gap-2">
<div class="p-1.5 bg-rose-500/10 text-rose-500 rounded-lg border border-rose-500/20"><svg class="w-3 h-3" 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></div>
<span>Supprimer</span>
</div>
</div>
</div>
{# PAGINATION #}
{% if quotes.getTotalItemCount is defined and quotes.getTotalItemCount > quotes.getItemNumberPerPage %}
<div class="mt-8 flex justify-center custom-pagination">

View File

@@ -0,0 +1,45 @@
{% extends 'mails/base.twig' %}
{% block content %}
<mj-section background-color="#ffffff" padding-top="20px">
<mj-column width="100%">
<mj-text font-size="14px" color="#475569" font-family="Arial, sans-serif" line-height="1.6">
Le contrat de location n°<strong>{{ datas.contrat.numReservation }}</strong> a été <span style="color: #ef4444; font-weight: bold;">refusé</span> par le client <strong>{{ datas.contrat.customer.name }} {{ datas.contrat.customer.surname }}</strong>.
</mj-text>
</mj-column>
</mj-section>
<mj-section background-color="#ffffff" padding="0px">
<mj-column width="90%" background-color="#fef2f2" border="1px solid #fecaca" border-radius="8px">
<mj-table font-family="Arial, sans-serif" font-size="14px" padding="15px">
<tr>
<td style="padding: 5px 0; color: #64748b;">N° Contrat :</td>
<td style="padding: 5px 0; text-align: right; font-weight: bold;">{{ datas.contrat.numReservation }}</td>
</tr>
<tr>
<td style="padding: 5px 0; color: #64748b;">Client :</td>
<td style="padding: 5px 0; text-align: right;">{{ datas.contrat.customer.name }} {{ datas.contrat.customer.surname }}</td>
</tr>
<tr>
<td style="padding: 5px 0; color: #64748b;">Raison du refus :</td>
<td style="padding: 5px 0; text-align: right; font-weight: bold; color: #ef4444;">{{ datas.raison }}</td>
</tr>
<tr>
<td style="padding: 5px 0; color: #64748b;">Date :</td>
<td style="padding: 5px 0; text-align: right;">{{ "now"|date("d/m/Y à H:i") }}</td>
</tr>
</mj-table>
</mj-column>
</mj-section>
<mj-section background-color="#ffffff">
<mj-column width="100%">
<mj-text font-size="13px" color="#64748b" font-family="Arial, sans-serif" font-style="italic" align="center">
Ce contrat est désormais marqué comme "Refusé". Veuillez vérifier le dossier client.
</mj-text>
<mj-button background-color="#1e293b" color="white" font-size="14px" font-weight="bold" href="https://intranet.ludikevent.fr/crm/contrats" border-radius="6px" padding-top="20px">
GÉRER LE CONTRAT
</mj-button>
</mj-column>
</mj-section>
{% endblock %}