{# templates/contributor/shipping_summary.html.twig #} {% extends 'base.html.twig' %} {% block title %}Récapitulatif des envois{% endblock %} {% block body %}

📚 Récapitulatif des envois de livres

{# Statistiques globales #}

Total contributeurs

{{ stats.total_contributors }}

Envoyés

{{ stats.shipped }}

{{ ((stats.shipped / stats.total_contributors) * 100)|number_format(1) }}%

En attente

{{ stats.pending }}

{{ ((stats.pending / stats.total_contributors) * 100)|number_format(1) }}%

Sans point relais

{{ stats.without_relay }}

{{ ((stats.without_relay / stats.total_contributors) * 100)|number_format(1) }}%

{# Section fusionnée : Détail et comparatif des livres physiques #}

📖 Détail par livre physique

{# Totaux globaux des livres en haut #}

📚 TOTAL TOUS LIVRES

{{ stats.books_stats.total_books }}
Total livres
{{ stats.books_stats.shipped_books }}
Livres envoyés
{{ stats.books_stats.total_books > 0 ? ((stats.books_stats.shipped_books / stats.books_stats.total_books) * 100)|number_format(1) : 0 }}%
{{ stats.books_stats.pending_books }}
Livres à envoyer
{{ stats.books_stats.total_books > 0 ? ((stats.books_stats.pending_books / stats.books_stats.total_books) * 100)|number_format(1) : 0 }}%
{# Table comparative des livres individuels #}
{% for title, data in stats.rewards_by_type %} {% if data.type == 'book' %} {% endif %} {% endfor %} {# Ligne de total #}
Livre Total Envoyés En attente % Envoyés % du total livres
📚 {{ title }} {{ data.total_quantity }} {{ data.shipped_quantity }} {{ data.pending_quantity }} {% set percentage = data.total_quantity > 0 ? ((data.shipped_quantity / data.total_quantity) * 100) : 0 %}
{{ percentage|number_format(1) }}%
{% set totalPercentage = stats.books_stats.total_books > 0 ? ((data.total_quantity / stats.books_stats.total_books) * 100) : 0 %} {{ totalPercentage|number_format(1) }}%
📚 TOTAL {{ stats.books_stats.total_books }} {{ stats.books_stats.shipped_books }} {{ stats.books_stats.pending_books }} {% set globalPercentage = stats.books_stats.total_books > 0 ? ((stats.books_stats.shipped_books / stats.books_stats.total_books) * 100) : 0 %}
{{ globalPercentage|number_format(1) }}%
100%
{# Répartition par nombre de livres par contributeur #}

📚 Nombre de livres par contributeur

{% for bookCount, data in stats.contributors_by_book_count %} {% endfor %}
Nombre de livres Contributeurs Envoyés En attente
{% if bookCount == 0 %} 0 livre (numérique/pack uniquement) {% elseif bookCount == 1 %} 1 livre {% else %} {{ bookCount }} livres {% endif %} {{ data.count }} contributeurs {{ data.shipped }} {{ data.pending }}
{# Analyse détaillée des récompenses #}

📋 Détail par type de récompense

{# Livres physiques #}

📚 Livres physiques

{% for title, data in stats.rewards_by_type %} {% if data.type == 'book' %}
{{ title }}
Total: {{ data.total_quantity }} | Envoyés: {{ data.shipped_quantity }} | En attente: {{ data.pending_quantity }}
{% endif %} {% endfor %}
{# Formats numériques #}

💻 Formats numériques

{% for title, data in stats.rewards_by_type %} {% if data.type == 'digital' %}
{{ title }}
Total: {{ data.total_quantity }} | Envoyés: {{ data.shipped_quantity }} | En attente: {{ data.pending_quantity }}
{% endif %} {% endfor %}
{# Packs internationaux #}

🌍 Packs internationaux

{% for title, data in stats.rewards_by_type %} {% if data.type == 'pack' %}
{{ title }}
Total: {{ data.total_quantity }} | Envoyés: {{ data.shipped_quantity }} | En attente: {{ data.pending_quantity }}
{% endif %} {% endfor %}
{# Liste détaillée des contributeurs avec nombre de livres #}

👥 Détail par contributeur (nombre de livres)

{% for contributor in contributors %} {% set bookCount = 0 %} {% for reward in contributor.rewards %} {% if reward.title in physical_books %} {% set bookCount = bookCount + reward.quantity %} {% endif %} {% endfor %} {% endfor %}
Nom Livres Détail Statut
{{ contributor.deliveryFirstName }} {{ contributor.deliveryLastName|upper }}
{{ contributor.email }}
{{ bookCount }} {% for reward in contributor.rewards %}
{% if reward.title in physical_books %}📚{% elseif reward.title == 'L\'epub' %}💻{% else %}📦{% endif %} {{ reward.title }} {% if reward.variation %} ({{ reward.variation }}){% endif %} x{{ reward.quantity }}
{% endfor %}
{% if contributor.shipped %} ✅ Envoyé {% else %} {% if not contributor.relayName %} ❌ Sans relais {% else %} ⏳ En attente {% endif %} {% endif %}
{# Liens d'actions #}
← Retour à la liste Voir les envois traités Contributeurs sans point relais
{% endblock %}