{% extends '@App/app.html.twig' %} {% block title %}Bons de commande{% endblock %} {% block page_header %}{% endblock %} {% block content %} {% set visible_total = rows|length %} {% set draft_count = rows|filter(row => row.order.status == 'draft')|length %} {% set sent_count = rows|filter(row => row.order.status == 'sent')|length %} {% set confirmed_count = rows|filter(row => row.order.status == 'confirmed')|length %} {% set closed_count = rows|filter(row => row.order.status == 'closed')|length %}

Bons de commande

Créez, faites signer et suivez les commandes de vos clients.

{% if is_granted('SALES_ORDER_CREATE') %}Nouveau bon de commande {% elseif not ordersEnabled %}{% endif %}
{% if not ordersEnabled %}
La création de bons de commande est désactivée pour cette société. {% if is_granted('BILLING_SETTINGS_EDIT') %}Ouvrir les paramètres de facturation et cocher « Activer les bons de commande ».{% else %}Un administrateur peut l’activer dans les paramètres de facturation.{% endif %}
{% elseif not is_granted('SALES_ORDER_CREATE') %}
Votre rôle ne permet pas de créer un bon de commande.
{% endif %}
{% for kpi in [ {label: 'Bons affichés', value: visible_total, icon: 'ti ti-files', tone: 'indigo', trend: 'Sélection courante'}, {label: 'Brouillons', value: draft_count, icon: 'ti ti-pencil', tone: 'red', trend: 'À finaliser'}, {label: 'Envoyés', value: sent_count, icon: 'ti ti-send', tone: 'green', trend: 'En attente de confirmation'}, {label: 'Confirmés', value: confirmed_count, icon: 'ti ti-circle-check-filled', tone: 'violet', trend: 'Commandes confirmées'} ] %}
{{ kpi.label }}{{ kpi.value }}{{ kpi.trend }}
{% endfor %}
Réinitialiser

Bons de commande de la société active. Les indicateurs portent sur les résultats des filtres.

{{ visible_total }} bon{{ visible_total > 1 ? 's' : '' }} de commande
{% for row in rows %}{% set order = row.order %} {% set status_tone = order.status == 'confirmed' ? 'success' : (order.status == 'sent' ? 'warning' : (order.status == 'validated' ? 'info' : (order.status in ['cancelled','closed'] ? 'muted' : 'draft'))) %} {% set currency_label = order.currency == 'EUR' ? '€' : order.currency %} {% endfor %}
DocumentClientDateStatutTotal TTCFacturé / reste TTCFacturationExécution / responsableActions
{{ order.number ?: 'Brouillon' }}{{ order.customerOrderReference ?: 'Sans référence' }} {{ order.customerNameSnapshot }} {{ order.issueDate|date('d/m/Y') }} {{ row.status }} {% if row.summary %}{{ row.summary.orderTotalTtc|number_format(2, ',', ' ') }} {{ currency_label }}{% else %}—{% endif %} {% if row.summary %}{{ row.summary.grossInvoicedTtc|number_format(2, ',', ' ') }} / {{ row.summary.remainingToInvoice|number_format(2, ',', ' ') }} {{ currency_label }}{% else %}—{% endif %} {% if row.summary %}{{ invoicingLabels[row.summary.invoicingStatus] }}{% if row.summary.draftInvoiceCount %}
Brouillon en préparation{% endif %}{% else %}—{% endif %}
{{ order.expectedExecutionDate ? order.expectedExecutionDate|date('d/m/Y') : '—' }}
{{ order.responsibleUser ? order.responsibleUser.prenom ~ ' ' ~ order.responsibleUser.nom : '' }}
{% if is_granted('SALES_ORDER_EDIT_DRAFT', order) %}{% endif %}
Aucun bon de commande ne correspond aux filtres.
{% endblock %}