{# templates/contributor/detail.html.twig #} {% extends 'base.html.twig' %} {% block title %} {% if contributor.shipped %} Détail de l'expédition - {{ contributor.name }} {% else %} Préparer l'envoi - {{ contributor.name }} {% endif %} {% endblock %} {% block body %}
{# En-tête avec titre et statut #}

{{ contributor.name }}

{% if contributor.shipped %} ✅ Envoi créé - Tracking #{{ contributor.trackingNumber }} {% else %} ⏳ En attente de création d'envoi {% endif %}
{# Actions principales en haut à droite #}
{% if contributor.shipped %} {# Actions pour contributeur déjà expédié #} 📄 Voir dans Connect 🖨️ Télécharger l'étiquette {% else %} {# Actions pour contributeur en attente #} {% if shipping_readiness.can_ship %}
{% else %} {% endif %} {% endif %}

Informations de livraison

Nom: {{ contributor.deliveryFirstName ?? contributor.billingFirstName }} {{ contributor.billingLastName }}

Email: {{ contributor.email }}

{% if contributor.ululesId %}

ID Ulule: {{ contributor.ululesId }}

{% endif %}

Adresse: {{ contributor.deliveryAddress ?? contributor.address }}

{% if contributor.deliveryAddress2 %}

Complément: {{ contributor.deliveryAddress2 }}

{% endif %}

Code postal: {{ contributor.deliveryPostalCode ?? contributor.postalCode }}

Ville: {{ contributor.deliveryCity ?? contributor.city }}

Pays: {{ contributor.deliveryCountry ?? contributor.country }}

Téléphone: {{ contributor.deliveryPhone ?? contributor.phone }}

Point Relais de livraison

{% if contributor.relayName %}

Nom: {{ contributor.relayName }}

Adresse: {{ contributor.relayAddress }}

ID: {{ contributor.relayId }}

{% else %}

❌ Aucun point relais défini

{% if not contributor.shipped %} Envoyer email de sélection {% endif %} {% endif %}
{# Colonne 1: Liste des contreparties #}

Contreparties à expédier

{% for reward in contributor.rewards %}

{{ reward.title }}

{% if reward.variation %}

Variation: {{ reward.variation }}

{% endif %}
×{{ reward.quantity }}
{{ reward.weight|number_format(0) }}g par unité
{% endfor %}
{# Colonne 2: Informations de poids et contrôles #}
{# Récapitulatif du poids #}

Poids total du colis

{{ contributor.totalWeight|number_format(0) }}
grammes
{% if contributor.totalWeight > 1000 %}
({{ (contributor.totalWeight / 1000)|number_format(1) }}kg)
{% endif %}
Calculé automatiquement




{# Colonne 3: Informations de poids et contrôles #}
{# Contrôle du poids manuel #} {% if not contributor.shipped %}

Ajustement manuel

g

Limite : 100g - 5kg maximum

Ce poids sera utilisé uniquement pour cette expédition.

{% endif %}
{% set estimated_price = contributor.estimatedShippingPrice %}

💰 Estimation du coût d'envoi

{% if estimated_price > 0 %}

Poids total : {{ contributor.totalWeight|number_format(0) }}g

Destination : {{ contributor.deliveryCountry ?? contributor.country ?? 'FR' }}

Prix estimé : {{ estimated_price|number_format(2) }} EUR

💡 Prix indicatif - Ajustez selon vos tarifs négociés

{% else %}

Destination non supportée ({{ contributor.deliveryCountry ?? contributor.country ?? 'FR' }})

{% endif %}
{# Vérifications avant envoi (seulement si pas encore expédié) #} {% if not contributor.shipped %}

Vérifications avant envoi

{% for checkName, check in shipping_readiness.checks %} {% if checkName == 'relay_validation' %} {# Cas spécial pour la validation du point relais avec détails #}
{% if check.valid %} {% else %} {% endif %}

Validation du point relais

{{ check.message }}

{# Afficher les détails du point relais si valide #} {% if check.valid and check.relayData %}

Nom : {{ check.relayData.Nom }}

ID : {{ check.relayData.Pays }}{{ contributor.formatRelayId }}

Adresse : {{ check.relayData.Adresse1 }}

Ville : {{ check.relayData.CP }} {{ check.relayData.Ville }}

{% if check.relayData.Distance %}

Distance : {{ check.relayData.Distance }}m

{% endif %}
    {% if check.relayData.Horaires_Lundi %}
  • Lundi : {{ check.relayData.Horaires_Lundi }}
  • {% endif %} {% if check.relayData.Horaires_Mardi %}
  • Mardi : {{ check.relayData.Horaires_Mardi }}
  • {% endif %} {% if check.relayData.Horaires_Mercredi %}
  • Mercredi : {{ check.relayData.Horaires_Mercredi }}
  • {% endif %} {% if check.relayData.Horaires_Jeudi %}
  • Jeudi : {{ check.relayData.Horaires_Jeudi }}
  • {% endif %} {% if check.relayData.Horaires_Vendredi %}
  • Vendredi : {{ check.relayData.Horaires_Vendredi }}
  • {% endif %} {% if check.relayData.Horaires_Samedi %}
  • Samedi : {{ check.relayData.Horaires_Samedi }}
  • {% endif %} {% if check.relayData.Horaires_Dimanche %}
  • Dimanche : {{ check.relayData.Horaires_Dimanche }}
  • {% endif %}
{% endif %}
{% else %} {# Cas normal pour les autres vérifications #}
{% if check.valid %} {% elseif check.blocking %} {% else %} ⚠️ {% endif %}

{% if checkName == 'weight' %}Poids du colis {% elseif checkName == 'required_data' %}Données obligatoires {% elseif checkName == 'phone' %}Numéro de téléphone pour SMS {% elseif checkName == 'relay_point' %}Point relais valide {% elseif checkName == 'geographical_coherence' %}Cohérence géographique {% endif %}

{% if checkName == 'required_data' %} {% if check.valid %} ✅ Toutes présentes : Email, Nom, Adresse, Code postal, Ville {% else %} ❌ {{ check.message }} {% endif %} {% elseif checkName == 'geographical_coherence' %} {{ check.message }} {% if check.details.contributor_location is defined and check.details.relay_location is defined %} {% if check.valid and check.details.reason == 'same_postal_code' %}
📍 {{ check.details.contributor_location }} ↔ {{ check.details.relay_location }} {% elseif not check.valid %}
📍 Contributeur: {{ check.details.contributor_location }}
📍 Point relais: {{ check.details.relay_location }} {% endif %} {% endif %} {% else %} {{ check.message }} {% endif %}

{% endif %} {% endfor %}
{% endif %} {# Actions en bas #}
← Retour à la liste
{% if contributor.shipped %} {# Actions pour contributeur expédié #}
{% else %} {# Actions pour contributeur en attente #} {% if shipping_readiness.can_ship %}
{% else %} {% endif %} {% endif %}
{% if not contributor.shipped and not shipping_readiness.can_ship %}
L'expédition ne peut pas être créée :
Veuillez corriger les erreurs indiquées ci-dessus avant de procéder.
{% endif %}
{% endblock %}