{% extends 'admin/hub/layout.html.twig' %} {% set hub_title = 'Bons de livraison' %} {% set hub_breadcrumbs = [ { label: 'Bons de livraison', url: path('app_bl_hub') }, { label: 'BL #' ~ bonLivraison.id } ] %} {% block title %}Extraction BL #{{ bonLivraison.id }} - Mercuriale.io{% endblock %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block hub_content %}
{# Header #}

Bon de livraison {% if bonLivraison.numeroBl %}{{ bonLivraison.numeroBl }}{% else %}#{{ bonLivraison.id }}{% endif %}

{{ bonLivraison.statut.label }}

{% if bonLivraison.fournisseur %}{{ bonLivraison.fournisseur.nom }} — {% endif %}{{ bonLivraison.etablissement.nom }} {% if bonLivraison.dateLivraison %} — {{ bonLivraison.dateLivraison|date('d/m/Y') }} {% endif %}

{# Main content - 2 columns #}
{# Left column - Image #}
Image du BL
{% if bonLivraison.imagePath %}
Bon de livraison
{% else %}
{% endif %}
{# Right column - Extracted data #}
Données extraites {% if bonLivraison.donneesBrutes %} {% set confiance = bonLivraison.donneesBrutes.confiance|default('basse') %} Confiance: {{ confiance }} {% endif %}
{% if needsExtraction %} {# Extraction needed #}

Extraction automatique

Cliquez pour extraire les données du bon de livraison via IA

{# Loading state #}
{% else %} {# Show extracted data #}
{% include 'app/bon_livraison/_extraction_data.html.twig' %}
{% endif %}
{# Image modal #}
{# Action buttons #} {% if not needsExtraction and bonLivraison.statut.value == 'BROUILLON' %}
{{ bonLivraison.lignes|length }} ligne(s) {% set alertCount = 0 %} {% for ligne in bonLivraison.lignes %} {% set alertCount = alertCount + ligne.alertes|length %} {% endfor %} {% if alertCount > 0 %} — {{ alertCount }} alerte(s) {% endif %} {% if bonLivraison.totalHt %} — Total HT: {{ bonLivraison.totalHt|number_format(2, ',', ' ') }} € {% endif %}
{% endif %}
{% endblock %}