{% extends "mag/base_mag_ecom.html" %} {% load static %} {% block title %}AUTO-PIECE{% endblock title %} {% block page %}Livraisons en ligne{% endblock page %} {% block extra_head %} {% endblock extra_head %} {% block main_content %}
{% include "mag/partials/_periode_filter_modal.html" %} {% include "mag/partials/_dashboard_kpi_styles.html" %}
{% include "mag/partials/_kpi_row_livraison_cmd_online.html" %}

{{ commandes|length }} livraison{% if commandes|length != 1 %}s{% endif %} assignée{% if commandes|length != 1 %}s{% endif %} {% if filtre_resume %} · {{ filtre_resume }} {% endif %}

{% if peut_agir_livreur %}Vos stats portent uniquement sur vos assignations. {% endif %} Encaissement : Payer (stock) puis Livrer.

{% if local %} {{ local.nom }} {% elif can_choose_localite %} Toutes les localités {% elif peut_agir_livreur %} Mes assignations {% endif %}
{% include "mag/partials/_alpine_table_toolbar.html" with search_placeholder="Rechercher n°, client, localité…" %}
{% for cmd in commandes %} {% empty %} {% endfor %}
N° Commande Client Localité Adresse Mode Total Statut Paiement Actions
{{ forloop.counter }} {{ cmd.numero_commande }} {{ cmd.panier.utilisateur.username|default:cmd.panier.nom_client|default:"—" }} {{ cmd.panier.local_entrepot.nom|default:"—" }} {% if cmd.panier.mode_reception == 'livraison' %}
{% if cmd.panier.livraison_ville %}{{ cmd.panier.livraison_ville.nom }}{% if cmd.panier.livraison_commune %} · {{ cmd.panier.livraison_commune.nom }}{% endif %}{% endif %} {% if cmd.panier.adresse_domicile %}{{ cmd.panier.adresse_domicile }}{% endif %} {% if cmd.panier.telephone_livraison %}Tél. {{ cmd.panier.telephone_livraison }}{% endif %} {% if cmd.panier.instruction_livraison %}{{ cmd.panier.instruction_livraison }}{% endif %}
{% else %} Retrait {% endif %}
{{ cmd.panier.get_mode_reception_display|default:"—" }} {{ cmd.total|floatformat:0 }} FCFA
{% if cmd.statut_commande == 'en_attente' %} {{ cmd.get_statut_commande_display }} {% elif cmd.statut_commande == 'valider' %} {{ cmd.get_statut_commande_display }} {% elif cmd.statut_commande == 'livrer' %} {{ cmd.get_statut_commande_display }} {% elif cmd.statut_commande == 'annuler' %} {{ cmd.get_statut_commande_display }} {% else %} {{ cmd.get_statut_commande_display }} {% endif %}
{% if cmd.statut_commande == 'annuler' %} — {% elif cmd.paye %} Payée {% else %} Impayée {% endif %}
{% if cmd.statut_commande == 'annuler' %} Annulée {% elif peut_agir_livreur and cmd.livreur_id == request.user.pk %} {% if not cmd.paye %}
{% csrf_token %}
{% elif cmd.statut_commande != 'livrer' %} Payée
{% csrf_token %}
{% else %} Livrée {% endif %} {% else %} {% if cmd.livreur %}{{ cmd.livreur.get_full_name|default:cmd.livreur.username }}{% endif %} {% if cmd.statut_commande == 'livrer' %} Livrée {% elif cmd.paye %} Payée {% endif %} {% endif %}
Aucune livraison pour cette période.
{% if commandes %} {% include "mag/partials/_table_pager.html" %} {% endif %}
{% endblock main_content %} {% block extra_js %} {% include "mag/partials/_periode_filter_js.html" %} {% include "mag/partials/_pusher_cmd_ligne_js.html" with page_mode="livraison" %} {% endblock extra_js %}