{% extends 'admin/base_admin.html.twig' %} {% block page_title %}Commande {{ commande.reference }}{% endblock %} {% block content %}
📍 Suivi de commande
{% set currentStatus = commande.status %} {% set statuses = ['draft', 'pending', 'paid', 'completed'] %} {% set currentIndex = currentStatus in statuses ? statuses|filter((s) => s == currentStatus)|keys|first : 0 %}
📝
Brouillon
En attente
💳
Payée
Terminée
{% if currentStatus == 'cancelled' %}
❌ Cette commande a été annulée
{% endif %}
📋 Détails de la commande
Référence
{{ commande.reference }}
Date
{{ commande.createdAt|date('d/m/Y H:i') }}
Type de pack
Pack {{ commande.packType|capitalize }}
Nombre de cartes
{{ commande.beneficiaires|length }} carte(s)
Statut
{% set statusClass = {'draft':'badge-draft','pending':'badge-pending','paid':'badge-paid','processing':'badge-processing','completed':'badge-completed','cancelled':'badge-cancelled'} %} {% set statusLabel = {'draft':'Brouillon','pending':'En attente','paid':'Pay\u00e9e','processing':'En cours','completed':'Termin\u00e9e','cancelled':'Annul\u00e9e'} %} {{ statusLabel[commande.status] ?? commande.status }}
{% if commande.paidAt %}
Payée le
{{ commande.paidAt|date('d/m/Y H:i') }}
{% endif %}
💰 Récapitulatif
Sous-total HT{{ commande.totalHT|number_format(2, ',', ' ') }} €
TVA (20%){{ (commande.totalTTC - commande.totalHT)|number_format(2, ',', ' ') }} €
Total TTC{{ commande.totalTTC|number_format(2, ',', ' ') }} €
{% if commande.isPaid %}
✅ Paiement effectué
{% endif %}
💳 Cartes commandées ({{ commande.beneficiaires|length }})
{% if commande.beneficiaires|length > 0 %}
{% for beneficiaire in commande.beneficiaires %}
{% if beneficiaire.initiales %}{{ beneficiaire.initiales }} {% else %}{{ beneficiaire.prenom|slice(0,1)|upper }}{{ beneficiaire.nom|slice(0,1)|upper }}{% endif %}
{{ beneficiaire.prenom }} {{ beneficiaire.nom }}
{% if beneficiaire.fonction %}
{{ beneficiaire.fonction }}{% if beneficiaire.entreprise %} • {{ beneficiaire.entreprise }}{% endif %}
{% endif %} {% if beneficiaire.email %}
📧 {{ beneficiaire.email }}
{% endif %}
{{ beneficiaire.price|number_format(2, ',', ' ') }} € HT
Template #{{ beneficiaire.charteTemplate ?? 1 }}
{% if is_granted('ROLE_ADMIN') %}
{{ beneficiaire.isActive ? '✅ Active' : '⛔ Inactive' }}
{% endif %} {% if commande.status in ['paid', 'completed'] %} {% if 'multi' in commande.packType %} {% set cardSlug = 'multi-' ~ commande.id %} {% set cardUrl = url('app_carte_show', {slug: cardSlug}) %} {% else %} {% set cardSlug = (beneficiaire.prenom ~ '-' ~ beneficiaire.nom)|lower|replace({' ': '-', 'é': 'e', 'è': 'e', 'ê': 'e', 'à': 'a', 'â': 'a', 'ù': 'u', 'û': 'u', 'î': 'i', 'ô': 'o', 'ç': 'c'}) %} {% set cardUrl = 'https://' ~ cardSlug ~ '.num-ecard.com' %} {% endif %}
✏️ Modifier {% if beneficiaire.isNextModificationFree or is_granted('ROLE_ADMIN') %}Gratuit{% endif %} {% if commande.packType in ['premium', 'force-vente', 'forcevente'] or 'multi' in commande.packType %} 📣 Mon Actu {% else %}{% endif %} {% if not beneficiaire.isActive %} 👁️ Prévisualiser {% else %} 🌐 Voir la carte {% endif %} 📊 Analytics {# -- Bouton Signature Email -- #}
{# -- Modal QR Code -- #}
📱 QR Code
QR Code
{# -- Modal Signature Email -- #}
✉ Signature email
Prêt à coller dans Gmail · Outlook · Apple Mail
🛡️ Aucun tracking des destinataires — les visites sont comptabilisées dans le tableau de bord uniquement.
{% endif %} {# TRACKING STATS #} {% if trackingStats is defined and trackingStats[beneficiaire.id] is defined %} {% set stats = trackingStats[beneficiaire.id] %} {% set bid = beneficiaire.id %}
📊 Statistiques de la carte
{% set totalClics = stats.clics|reduce((carry, v) => carry + v, 0) %} {% if stats.vues > 0 or totalClics > 0 %}
{{ stats.vues }}
Vues
{{ totalClics }}
Clics
{% if stats.vues > 0 and totalClics > 0 %}{{ ((totalClics / stats.vues) * 100)|round }}%{% else %}—{% endif %}
Taux clic
{% if stats.recentEvents is defined and stats.recentEvents|length > 0 %} {% set bid = beneficiaire.id %}
📋 Historique des événements
Période :
DateHeureActionAppareilSourcePays
{% endif %} {% else %}
Aucune visite enregistrée pour le moment
{% endif %}
{% endif %}
{% endfor %}
{% else %}
💳
Aucune carte

Cette commande ne contient pas de cartes.

{% endif %}
📄 Mes documents & factures
{% if commande.status in ['paid', 'completed'] %} {% endif %} {% if modificationInvoices is defined and modificationInvoices|length > 0 %} {% for inv in modificationInvoices %} {% endfor %} {% endif %} {% if commande.status not in ['paid', 'completed'] and (modificationInvoices is not defined or modificationInvoices|length == 0) %} {% endif %}
TypeRéférenceDateCarteMontant TTC⬇️
🧾 Commande
{{ commande.reference }}
Achat initial
{{ commande.paidAt ? commande.paidAt|date('d/m/Y') : commande.createdAt|date('d/m/Y') }} {{ commande.beneficiaires|length }} carte(s) — Pack {{ commande.packType|capitalize }} {{ commande.totalTTC|number_format(2, ',', ' ') }} €
HT : {{ commande.totalHT|number_format(2, ',', ' ') }} €
⬇️ PDF
✏️ Modification
{{ inv.reference }}
Modification n°{{ inv.modificationNumber }}
{{ inv.createdAt|date('d/m/Y') }} {{ inv.beneficiaire.prenom }} {{ inv.beneficiaire.nom }} {% if inv.priceTTC == 0 %}Offert
0,00 € HT
{% else %}{{ inv.priceTTC|number_format(2, ',', ' ') }} €
HT : {{ inv.priceHT|number_format(2, ',', ' ') }} €
{% endif %}
⬇️ PDF
📭 Aucun document disponible pour le moment
Une question sur votre commande ?
Notre équipe est là pour vous aider
Nous contacter
{% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}