{% extends "base.html" %} {% load i18n %} {% load static %} {% load short_name %} {% block content %}
{# ── En-tête ─────────────────────────────────────────────── #}

{% translate "Inventaire" %} #{{ inventory.id }}

{# ── Badge de statut (cliquable pour les gestionnaires si autorisé) ── #} {% if can_change_status and not inventory.is_validated and inventory.status != 'done' or can_change_status and not inventory.is_validated and can_validate %} {% else %} {{ inventory.get_status_display }} {% endif %} {% if inventory.is_editable %} {% endif %} {% if can_validate and not inventory.is_validated %} {% endif %}
{# ── Infos générales ────────────────────────────────────── #}
{% translate "Emplacement" %}
{{ inventory.warehouse_location.name }}
{% translate "Entrepôt" %}
{{ inventory.warehouse_location.warehouse.name }}
{% translate "Responsable" %}
{{ inventory.performed_by|default:_("Non renseigné") }}
{% translate "Créé le" %}
{{ inventory.created_at }}
{% translate "Validé le" %}
{{ inventory.validated_at|default:_("Non validé") }}
{% if inventory.validated_by %}
{% translate "Validé par" %}
{{ inventory.validated_by.get_full_name|default:inventory.validated_by.username }}
{% endif %} {% if inventory.validator_comment %}
{% translate "Commentaire validateur" %}
{{ inventory.validator_comment }} {% if can_validate %} {% endif %}
{% elif can_validate %}
{% translate "Commentaire validateur" %}
{% endif %}
{% if inventory.qr_code %}

{% translate "QR Code" %}

QR Code Inventaire #{{ inventory.id }}
{% endif %}
{# ── Résumé des écarts ──────────────────────────────────── #}
{{ items|length }}
{% translate "Articles" %}
0
{% translate "Écarts négatifs" %}
0
{% translate "Écarts positifs" %}
0
{% translate "Sans écart" %}
{# ── Filtre écarts ──────────────────────────────────────── #}
{# ── Tableau des articles ───────────────────────────────── #} {# Formulaire caché pour la validation par lot des articles filtrés #}
{% csrf_token %}
{% if can_validate and not inventory.is_validated %} {% endif %} {% if inventory.is_editable and can_validate %} {% endif %} {% for item in items %} {% if can_validate and not inventory.is_validated %} {% endif %} {% if inventory.is_editable and can_validate %} {% endif %} {% empty %} {% endfor %}
{% translate "Produit" %} {% translate "Emplacement" %} {% translate "Qté attendue" %} {% translate "Qté comptée" %} {% translate "Écart" %} {% translate "Statut" %}
{{ item.product.name }} {% if item.comment %}
{{ item.comment_by|short_name|default:"?" }} — {{ item.comment }} {% endif %} {% if item.validator_comment %}
{{ item.validator_comment_by|short_name|default:"?" }} — {{ item.validator_comment }} {% endif %}
{{ inventory.warehouse_location.name }} {{ item.expected_quantity }}
{% if inventory.is_editable and inventory.is_quantity_editable or can_validate and inventory.is_editable %} {% else %} {{ item.counted_quantity }} {% endif %} {% if item.comment or item.validator_comment or inventory.is_editable or can_validate %} {% endif %}
{% if item.difference > 0 %}+{% endif %}{{ item.difference }} {% if item.is_validated %} {% translate "Validé" %} {% else %} {% translate "En attente" %} {% endif %}
{% translate "Aucun article dans cet inventaire." %}
{% translate "Retour à la liste" %}
{# ── Modal commentaire ────────────────────────────────── #} {# ── Modal Validation Globale avec Commentaire ─────────────── #} {% if can_validate and not inventory.is_validated %} {% endif %} {# ── Modal Commentaire Général Validateur ────────────────── #} {% if can_validate %} {% endif %} {# ── Modal QR Code ───────────────────────────────────────────── #} {% endblock content %} {% block script %} {% endblock script %}