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

{% if batch.movement_type == 'in' %} {% translate "Entrée" %} {% elif batch.movement_type == 'out' %} {% translate "Sortie" %} {% else %} {% translate "Transfert" %} {% endif %} {% if batch.movement_subtype %} {{ batch.get_movement_subtype_display }} {% endif %} {% translate "Lot" %} #{{ batch.pk }}

{% translate "Retour" %}

{% translate "Date" %}

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

{{ batch.date|date:"H:i" }}
{% translate "Créé par" %}

{{ batch.created_by.get_full_name|default:batch.created_by.username|default:"—" }}

{% if batch.requester %}
{% translate "Demandeur" %}

{{ batch.requester }}

{% endif %}
{% translate "Raison" %}
{% if batch.reason %}

{{ batch.reason }}

{% else %}

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

{% endif %}
{% if batch.is_loan %}
{% translate "Suivi du prêt de matériel" %}
{% if batch.loan_returned %} {% translate "Matériel retourné" %} {% else %} {% if batch.is_overdue %} {% translate "En retard" %} {% else %} {% translate "En cours de prêt" %} {% endif %} {% endif %}

{% translate "Date de retour attendue" %} : {{ batch.estimated_return_date|date:"d/m/Y"|default:"-" }}

{% if batch.loan_returned %} {% translate "Le matériel a été retourné." %} {% else %} {% if batch.is_overdue %} {% translate "Le retour de ce matériel est en retard !" %} {% else %} {% translate "Le matériel est actuellement prêté." %} {% endif %} {% endif %}

{% if can_add_signature %}
{% csrf_token %} {% if batch.loan_returned %} {% else %} {% endif %}
{% endif %}
{% elif can_add_signature and batch.movement_type == 'out' %}
{% translate "Ce mouvement ne concerne pas un prêt actuellement." %}
{% endif %} {% if batch.movement_type != 'transfer' and batch.person or batch.movement_type != 'transfer' and batch.company %}{# or batch.contract #}
{% if batch.person %}
{% translate "Personne" %}

{{ batch.person.name }}

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

{{ batch.company.name }}

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

{{ batch.contract.contract_number }}

{% if batch.contract.company %} {{ batch.contract.company.name }} {% endif %}
{% endif %}{% endcomment %}
{% endif %} {% if batch.preparation_order or batch.purchase_order %}
{% if batch.preparation_order %}
{% translate "Bon de préparation" %}

#{{ batch.preparation_order.order_number }}

{{ batch.preparation_order.get_status_display }}
{% endif %} {% if batch.purchase_order %}
{% translate "Commande d'achat" %}

{{ batch.purchase_order.code }}

{% if batch.purchase_order.supplier %} {{ batch.purchase_order.supplier.name }} {% endif %}
{% endif %}
{% endif %}
{% translate "Lignes du mouvement" %} {{ batch.movements.count }}
{% for mv in batch.movements.all %} {% empty %} {% endfor %}
{% translate "Produit" %} {% translate "Catégorie" %} {% translate "Quantité" %} {% translate "Source" %} {% translate "Destination" %}
{{ mv.product.name }} {% if mv.product.code %}
{{ mv.product.code }} {% endif %}
{{ mv.product.category.name_fr|default:"—" }} {% if mv.destination_location and not mv.source_location %}+{% endif %} {% if mv.source_location and not mv.destination_location %}-{% endif %} {{ mv.quantity }} {% if mv.source_location %} {{ mv.source_location.name }}
{{ mv.source_location.warehouse.name }} {% else %}—{% endif %}
{% if mv.destination_location %} {{ mv.destination_location.name }}
{{ mv.destination_location.warehouse.name }} {% else %}—{% endif %}
{% translate "Aucune ligne." %}
{% translate "Signatures" %}
{% if batch.signature or batch.signatures.all %}
{% if batch.signature %}
{% translate "Signature principale" %}
{% translate 'Signature' %} {% if batch.signature_name %}
{{ batch.signature_name }}
{% endif %}
{% endif %} {% for sig in batch.signatures.all %}
{% translate "Signature" %} #{{ forloop.counter }}
{% translate 'Signature' %}
{{ sig.signature_name|default:sig.signed_by.get_full_name|default:sig.signed_by.username|default:"—" }} {{ sig.signed_at|date:"d/m/Y H:i" }}
{% endfor %}
{% else %}

{% translate "Aucune signature enregistrée." %}

{% endif %} {% if can_add_signature %}
{% translate "Ajouter une signature" %}
{% csrf_token %}
{% endif %}
{% if batch.documents.all %}
{% translate "Documents joints" %}
{% for doc in batch.documents.all %} {% private_file_url doc 'file' as doc_url %}
{% if doc.is_image %} {{ doc.name }} {% else %}
{% endif %}
{% endfor %}
{% endif %}
{% endblock content %}