{% extends 'front/base.html.twig' %} {% block title %}Détail échange{% endblock %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block body %}
Détails de l’échange
Consultez les articles à échanger, les nouveaux articles et le statut de votre échange.
Échange N° : {{ document.internalNbr }}
{% if statusView is defined and statusView %} {{ statusView.libelle }} {% endif %}
{# lien commande liée #} {% if linkedOrder is defined and linkedOrder %}
Commande liée
#{{ linkedOrder.internalNbr }}
Voir la commande
{% endif %} {# Timeline (si tu l’as déjà) #} {% if statusTimeline is defined and statusTimeline %}
{% for step in statusTimeline %}
{{ step.libelle }}
{% endfor %}
{% endif %}
{# ===== 1) PRODUITS À ÉCHANGER ===== #}
Produit(s) à échanger
Ancien
{% set hasOld = false %} {% for item in document.documentDeclinationProduits %} {% if item.type == 'declinationEchange' %} {% set hasOld = true %} {% endif %} {% endfor %} {% if not hasOld %} {% endif %}
{% set picture = 'galery_placeholder_200.png' %} {% for image in item.produitDeclinationValue.picture %} {% if image.isSelected %} {% set picture = image.imageName %} {% endif %} {% endfor %} {{ item.reference }}
{{ item.produitDeclinationValue.produit.name ?? '' }} – Ref : {{ item.produitDeclinationValue.produit.reference ?? item.reference }}
{{ (item.totalAmountTtc / item.quantity)|number_format(3,'.') }} TND
Quantité : {{ item.quantity }}
{{ item.totalAmountTtc|number_format(3,'.') }} TND
Aucun produit à échanger.
{# ===== 2) NOUVEAUX PRODUITS ===== #}
Nouveau(x) produit(s)
Nouveau
{% set hasNew = false %} {% for item in document.documentDeclinationProduits %} {% if item.type != 'declinationEchange' %} {% set hasNew = true %} {% endif %} {% endfor %} {% if not hasNew %} {% endif %}
{% set picture = 'galery_placeholder_200.png' %} {% for image in item.produitDeclinationValue.picture %} {% if image.isSelected %} {% set picture = image.imageName %} {% endif %} {% endfor %} {{ item.reference }}
{{ item.produitDeclinationValue.produit.name ?? '' }} – Ref : {{ item.produitDeclinationValue.produit.reference ?? item.reference }}
{% if item.discount and item.discount > 0 %}
{{ ( (item.totalAmountTtc / item.quantity) + ( item.discountType == 'percent' ? ((item.totalAmountTtc / item.quantity) * item.discount / 100) : item.discount ) )|number_format(3,'.') }} TND {% if item.discountType == 'percent' %} -{{ item.discount }}% {% else %} -{{ item.discount|number_format(3,'.') }} TND {% endif %} {{ (item.totalAmountTtc / item.quantity)|number_format(3,'.') }} TND
{% else %}
{{ (item.totalAmountTtc / item.quantity)|number_format(3,'.') }} TND
{% endif %}
Quantité : {{ item.quantity }}
{{ item.totalAmountTtc|number_format(3,'.') }} TND
Aucun nouveau produit.
{# ===== COL DROITE : RÉCAP (tu peux réutiliser ton bloc totals) ===== #}
{# Tu peux réutiliser exactement ton bloc "Récapitulatif des montants" de order_recap.html.twig #} {# + livraison + tracking si utile #} {# Exemple minimal : #} {% set deliveryTotal = document.deliveryPrice|default(0) %}
Récapitulatif des montants
Frais de livraison
{% if deliveryTotal == 0 %} Gratuite {% else %} {{ deliveryTotal|number_format(3,'.') }} TND {% endif %}
Total à payer
{{ document.totalAmountTtc|number_format(3,'.') }} TND
{% endblock %}