{% extends 'mobile/mobile_base.html' %} {% load static %} {% load i18n %} {% block title %}{% translate "Inventaire" %} #{{ inventory.id }}{% endblock title %} {% block upleft %} {% endblock upleft %} {% block extra_head %} {% endblock extra_head %} {% block content %} {# ── En-tête statut ───────────────────────────────────────────── #}
{% translate "Inventaire" %} #{{ inventory.id }}
{{ inventory.created_at|date:"d/m/Y" }}
{% if inventory.status == 'draft' %} {% translate "Brouillon" %} {% elif inventory.status == 'in_progress' %} {% translate "En cours" %} {% elif inventory.status == 'done' %} {% translate "Terminé" %} {% elif inventory.status == 'validated' %} {% translate "Validé" %} {% else %} {{ inventory.get_status_display }} {% endif %}
{# ── Actions rapides en haut ──────────────────────────────────── #} {% if can_validate and not inventory.is_validated %}
{% endif %} {% 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 %}
{% translate "Changer le statut" %}
{% csrf_token %}
{% if inventory.status != 'draft' %} {% endif %} {% if inventory.status != 'in_progress' %} {% endif %} {% if inventory.status != 'done' %} {% endif %}
{% endif %} {# ── Informations générales ───────────────────────────────────── #}
{% translate "Informations" %}
{% translate "Emplacement" %} {{ inventory.warehouse_location.name }}
{% translate "Entrepôt" %} {{ inventory.warehouse_location.warehouse.name }}
{% if inventory.performed_by %}
{% translate "Responsable" %} {{ inventory.performed_by }}
{% endif %} {% if inventory.validated_at %}
{% translate "Validé le" %} {{ inventory.validated_at|date:"d/m/Y H:i" }}
{% endif %} {% if inventory.validator_comment %}
{% translate "Commentaire du validateur" %} {% if can_validate %} {% endif %}
{{ inventory.validator_comment }}
{% elif can_validate %}
{% translate "Commentaire du validateur" %}
{% endif %}
{# ── Barre de progression ─────────────────────────────────────── #}
{% translate "Progression" %} —
{# ── Boutons filtre ───────────────────────────────────────────── #}
{# ── Liste des articles ───────────────────────────────────────── #}
{% translate "Articles" %} {{ items|length }}
{% if items %} {% for item in items %}
{# Indicateur sauvegarde – rempli dynamiquement #}
{{ item.product.name }}
{{ item.product.code }}
{% translate "Magasinier :" %} {{ item.comment }}
{% translate "Validateur :" %} {{ item.validator_comment }}
{% translate "Attendu" %}
{{ item.expected_quantity|default:"—" }}
{% translate "Compté" %}
{{ item.counted_quantity }}
{% if item.difference > 0 %}+{% endif %}{{ item.difference }}
{% if item.is_validated %} {% translate "Validé" %} {% else %} {% translate "En attente" %} {% endif %}
{% endfor %} {% else %}
{% translate "Aucun article dans cet inventaire." %}
{% endif %} {# ── Modal d'édition d'un article ─────────────────────────────── #} {# ── Données JSON pour le JS ──────────────────────────────────── #} {# ── Modal Validation Globale avec Commentaire (mobile) ────── #} {% if can_validate and not inventory.is_validated %} {% endif %} {# ── Modal Commentaire Général Validateur (mobile) ─────────── #} {% if can_validate %} {% endif %} {% endblock content %}