{% extends 'dashboard/base.twig' %} {% block title %}Catalogue Devis{% endblock %} {% block title_header %}Gestion des Devis & Offres{% endblock %} {% block actions %}
Nouveau Devis
{% endblock %} {% block body %}
{% 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 %} {# RÉFÉRENCE #} {# CLIENT #} {# DATE #} {# STATUT DYNAMIQUE #} {# MONTANT #} {# CAUTION #} {# ACTIONS #} {% else %} {% endfor %}
Référence Client Date Statut Total HT Caution Actions
{{ quote.ref|default('DEV-' ~ quote.id|upper) }} {{ quote.num }}
{{ quote.customer.surname|upper }} {{ quote.customer.name }} {{ quote.customer.phone|default(quote.customer.email) }}
{{ quote.createa|date('d/m/Y') }} {% 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', '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' } %} {% set statusLabels = { 'draft': 'Brouillon', 'created_waitsign': 'Attente Signature', 'wait-send': 'Envoi en cours', 'refused': 'Refusé', 'signed': 'Signé', 'signée': 'Signé' } %}
{% if status == 'created_waitsign' or status == 'wait-send' %} {% elseif status == 'signed' or status == 'signée' %} {% elseif status == 'refused' %} {% endif %} {{ statusLabels[status] ?? status }} {# AFFICHAGE RAISON REFUS #} {% if status == 'refused' and reason %}

{{ reason }}

{% endif %}
{% if quote.orderSession and quote.orderSession.promotion %} {{ (quote|totalQuotoHT)|number_format(2, ',', ' ') }}€ {{ (quote|totalQuotoBeforeDiscount)|number_format(2, ',', ' ') }}€ Promo -{{ quote.orderSession.promotion.percentage }}% {% else %} {{ (quote|totalQuotoHT)|number_format(2, ',', ' ') }}€ {% endif %}
{{ (quote|totalCaution)|number_format(2, ',', ' ') }}€
{# Renvoyer lien de signature (Autorisé aussi si refusé pour relancer) #} {% if status == "created_waitsign" or status == "wait-send" %} {% endif %} {# Modifier : Interdit uniquement si signé #} {% if status != "signed" and status != "refused" %} {% endif %} {# PDF Conditionnel #} {% if status == "signed" or status == "signée" %} {# PDF Signé #} {% if quote.contrats is null %} {# ÉTAT : AUCUN CONTRAT #} Contrat {% else %} {# ÉTAT : CONTRAT EXISTANT #} Contrat {% endif %} {% else %} {# PDF Brouillon / Attente #} {% endif %} {# Delete : Interdit si signé #} {% if status != "signed" and status != "signée" %} {% endif %}

Aucun devis trouvé

{# PAGINATION #} {% if quotes.getTotalItemCount is defined and quotes.getTotalItemCount > quotes.getItemNumberPerPage %}
{{ knp_pagination_render(quotes) }}
{% endif %} {% endblock %}