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

{% translate "Traiter le bon de préparation" %} {{ preparation_order.order_number }}

{% translate "Sélectionnez les emplacements et les quantités à sortir du stock" %}

{% csrf_token %} {% if has_modified_items %} {% endif %} {% if deleted_items_to_return %}
{% translate "Articles supprimés du bon (restitution automatique au stock)" %}

{% translate "Les articles ci-dessous avaient fait l'objet d'une sortie lors du traitement précédent mais ont été retirés du bon par le gestionnaire. Lors de la validation, le stock sera automatiquement recrédité." %}

    {% for del_item in deleted_items_to_return %}
  • {{ del_item.product.name }} ({{ del_item.product.code }})
    {% translate "Emplacement(s) d'origine" %} : {{ del_item.location_info }}
    +{{ del_item.executed_qty }} {{ del_item.product.unit }} {% translate "à restituer" %} {% if del_item.item %} {% endif %}
  • {% endfor %}
{% endif %}
{% translate "Produits à sortir / préparer" %}
{% for item_data in items_with_locations %}
{% if item_data.item.quantity_modified %} {% endif %} {{ item_data.item.product.name }} ({{ item_data.item.product.code }})
{% if item_data.item.quantity_modified %} {% translate "Quantité modifiée" %} : {{ item_data.item.previous_quantity }} → {{ item_data.item.quantity }} {{ item_data.item.product.unit }} {% endif %}
{% if item_data.executed_qty > 0 %} {% translate "Déjà sorti" %}: {{ item_data.executed_qty }} {% endif %} {% if item_data.delta > 0 %} +{{ item_data.delta }} {% translate "à prélever" %} {% elif item_data.delta < 0 %} {{ item_data.delta }} {% translate "à réintégrer" %} {% elif item_data.executed_qty > 0 %} {% translate "Inchangé" %} {% endif %} {% translate "Demandé" %}: {{ item_data.item.quantity }} {{ item_data.item.product.unit }} {% translate "Réservé" %}: {{ item_data.reserved }} {% translate "En commande" %}: {{ item_data.pending_orders }} {% translate "Disponible" %}: {{ item_data.available }}
{% if item_data.stocks %} {% with first_stock=item_data.stocks.0 %}
{{ first_stock.location.warehouse.name }} – {{ first_stock.location.name }} {% if item_data.executed_qty > 0 %} {% translate "Complément à sortir" %}: {{ item_data.suggested_quantity }} {{ item_data.item.product.unit }} {% else %} {% translate "Quantité à sortir" %}: {{ item_data.item.quantity }} {{ item_data.item.product.unit }} {% endif %}
{% if item_data.production_order %} {{ item_data.production_order.code }} {% endif %}
{% endwith %} {% else %} {% if item_data.fallback_locations %} {# Aucun stock existant mais des emplacements sont disponibles #}
{% if item_data.executed_qty > 0 %} {% translate "Complément à sortir" %}: {{ item_data.suggested_quantity }} {{ item_data.item.product.unit }} {% else %} {% translate "Quantité à sortir" %}: {{ item_data.item.quantity }} {{ item_data.item.product.unit }} {% endif %}
{% if item_data.production_order %} {{ item_data.production_order.code }} {% endif %}
{% translate "Aucun stock enregistré pour ce produit. Le stock passera en négatif après la sortie." %}
{% else %}
{% translate "Aucun stock disponible et aucun emplacement accessible pour ce produit" %}
{% endif %} {% endif %}
{% endfor %}
{% if other_items %}
{% translate "Autres produits demandés" %} {{ other_items|length }}
{% for oi_data in other_items %}
{{ oi_data.item.description }}
{{ oi_data.item.quantity }} {% if oi_data.item.category %} {{ oi_data.item.category.name_fr }} {% endif %} {% if oi_data.item.sign_panel_type %} {{ oi_data.item.sign_panel_type.code }} {% endif %}
{% if oi_data.production_order %} {{ oi_data.production_order.code }} {% endif %}
{% endfor %}
{% endif %}
{% translate "Retour" %}
{% endblock content %}