{% extends "base.html" %} {% load static %} {% load i18n %} {% block content %}

{% translate "Mouvement de stock" %} #{{ movement.pk }} {% if movement.source_location and movement.destination_location %} {% translate "Transfert" %} {% elif movement.destination_location %} {% translate "Entrée" %} {% else %} {% translate "Sortie" %} {% endif %} {% if movement.is_modified %} {% translate "Modifié" %} {% endif %}


{% translate "Produit" %}

{{ movement.product.name }}

{% if movement.product.code %} {{ movement.product.code }} {% endif %} {% if movement.product.category %}
{{ movement.product.category.name_fr }} {% endif %}
{% translate "Quantité" %}

{% if movement.source_location and movement.destination_location %} {{ movement.quantity }} {% elif movement.destination_location %} +{{ movement.quantity }} {% else %} {% if movement.quantity >= 0 %}-{% endif %}{{ movement.quantity }} {% endif %}

{% translate "Date et auteur" %}

{{ movement.date|date:"d/m/Y" }}

{{ movement.date|date:"H:i" }} {% if movement.author_name %} {{ movement.author_name }} {% endif %}
{% translate "Raison" %}
{% if movement.reason %}

{{ movement.reason }}

{% else %}

{% translate "Aucune raison indiquée" %}

{% endif %}
{% if movement.batch and movement.batch.person or movement.batch and movement.batch.company %}{# or movement.batch and movement.batch.contract #}
{% if movement.batch.person %}
{% translate "Personne" %}

{{ movement.batch.person.name }}

{{ movement.batch.person.teams_display }}
{% endif %} {% if movement.batch.company %}
{% translate "Entreprise / Organisation" %}

{{ movement.batch.company.name }}

{% endif %} {% comment %}{% if movement.batch.contract %}
{% translate "Contrat" %}

{{ movement.batch.contract.contract_number }}

{% if movement.batch.contract.company %} {{ movement.batch.contract.company.name }} {% endif %}
{% endif %}{% endcomment %}
{% endif %} {% if movement.batch %} {% endif %}
{% translate "Emplacement source" %}
{% if movement.source_location %}

{{ movement.source_location.name }}

{{ movement.source_location.warehouse.name }} {% else %}

{% translate "Aucun emplacement source (entrée directe)" %}

{% endif %}
{% translate "Emplacement destination" %}
{% if movement.destination_location %}

{{ movement.destination_location.name }}

{{ movement.destination_location.warehouse.name }} {% else %}

{% translate "Aucun emplacement destination (sortie directe)" %}

{% endif %}
{% translate "Historique des modifications" %}
{{ history_entries|length }} {% translate "événement(s)" %}
{% if history_entries %}
{% for entry in history_entries %} {% endfor %}
{% translate "Date / Heure" %} {% translate "Auteur" %} {% translate "Action" %} {% translate "Détails" %}
{{ entry.created_at|date:"d/m/Y H:i" }} {{ entry.author_short_name }} {{ entry.get_action_display }}
{{ entry.description }}
{% if entry.modification_reason %}
{% translate "Motif" %} : {{ entry.modification_reason }}
{% endif %}
{% else %}
{% translate "Aucun historique disponible pour ce mouvement." %}
{% endif %}
{% endblock content %}