{% extends 'app/base.html.twig' %} {% block title %}Bon de Commande N° {{ '%04d'|format(commande.id) }}{% endblock %} {% block body %} {# CSS impression #} {# ── En-tête ─────────────────────────────────────────────────────────────── #}

Bon de Commande N° {{ '%04d'|format(commande.id) }}

Retour à la liste Télécharger PDF
{# En-tête impression uniquement #}

{{ config.nom_etablissement ?? 'Restaurant Scolaire' }}

Bon de Commande N° {{ '%04d'|format(commande.id) }}

{# ── Ligne du haut : Infos générales + Statut ────────────────────────────── #}
{# ── Card Informations générales ────────────────────────────────────────── #}
Informations générales
{% if commande.convertie_en_achats %} {% endif %} {% if commande.notes %} {% endif %}
Date de commande : {{ commande.date_commande ? commande.date_commande|date('d/m/Y') : '—' }}
Fournisseur : {{ commande.fournisseur }}
Livraison souhaitée : {% if commande.date_livraison_souhaitee %}{{ commande.date_livraison_souhaitee|date('d/m/Y') }}{% else %}—{% endif %}
Statut : {% set badges = {brouillon: 'bg-secondary', envoyee: 'bg-warning text-dark', recue: 'bg-success', annulee: 'bg-danger'} %} {{ commande.statut|capitalize }}
Cette commande a été automatiquement ajoutée aux achats. Voir les achats générés
Notes : {{ commande.notes|nl2br }}
{# ── Card Mettre à jour le statut (non imprimé) ─────────────────────────── #}
Mettre à jour le statut
{% if commande.statut != 'envoyee' and destinataires is not empty %}
Email automatique : Quand vous passerez le statut à "Envoyée", un email sera automatiquement envoyé à : {{ destinataires|join(', ') }}
{% elseif commande.statut != 'envoyee' and destinataires is empty %}
Aucun email configuré : Configurez l'email du fournisseur ou l'email expéditeur (Paramètres → Email) pour l'envoi automatique.
{% endif %}
{# ── Tableau Produits commandés (pleine largeur) ──────────────────────────── #}
Produits commandés
{% if lignes is empty %} {% else %} {% set totalHT = 0 %} {% set totalTTC = 0 %} {% for ligne in lignes %} {% set qte = ligne.quantite ?? 0 %} {% set tva = ligne.taux_tva ?? 0 %} {% if ligne.is_ttc == 1 %} {% set prixTTC = ligne.prix_ttc ?? ligne.prix_ht ?? 0 %} {% set prixHT = tva > 0 ? prixTTC / (1 + tva / 100) : prixTTC %} {% else %} {% set prixHT = ligne.prix_ht ?? 0 %} {% set prixTTC = prixHT * (1 + tva / 100) %} {% endif %} {% set ligneHT = prixHT * qte %} {% set ligneTTC = prixTTC * qte %} {% set totalHT = totalHT + ligneHT %} {% set totalTTC = totalTTC + ligneTTC %} {% endfor %} {% endif %} {% if lignes is not empty %} {% endif %}
Produit Qté Unité Prix HT TVA Prix TTC Total HT Total TTC
Aucun produit dans cette commande
{{ ligne.produit }} {% if ligne.label %}{{ ligne.label }}{% endif %} {% if ligne.origine %}
{{ ligne.origine }}{% endif %}
{{ qte|number_format(3, ',', ' ') }} {{ ligne.unite ?? '' }} {{ prixHT > 0 ? prixHT|number_format(3, ',', ' ') ~ ' €' : '—' }} {{ tva }}% {{ prixTTC > 0 ? prixTTC|number_format(3, ',', ' ') ~ ' €' : '—' }} {{ ligneHT > 0 ? ligneHT|number_format(3, ',', ' ') ~ ' €' : '—' }} {{ ligneTTC > 0 ? ligneTTC|number_format(3, ',', ' ') ~ ' €' : '—' }}
Total HT : {{ totalHT|number_format(3, ',', ' ') }} € Total TTC : {{ totalTTC|number_format(3, ',', ' ') }} €
{# ── Zone signature (impression uniquement) ──────────────────────────────── #}

Date et signature de {{ config.nom_etablissement ?? 'la restauration' }} :

Date et signature du Fournisseur :

{# /row #} {# ── Boutons bas de page (non imprimés) ──────────────────────────────────── #}
Modifier Télécharger PDF {% if commande.statut == 'brouillon' %}
{% endif %}
{% endblock body %}