{% extends "mag/base_mag_ecom.html" %} {% load static %} {% load custom_filters %} {% block title %}AUTO-PIECE{% endblock title %} {% block page %}Historique commandes{% endblock page %} {% block extra_head %} {% endblock extra_head %} {% block main_content %}
{% include "mag/partials/_periode_filter_modal.html" %}

{{ historique_rows|length }} historique{% if historique_rows|length > 1 %}s{% endif %}

{% include "mag/partials/_alpine_table_toolbar.html" with search_placeholder="Rechercher n°, ticket, utilisateur…" %}
{% for row in historique_rows %} {% with item=row.item ticket=row.ticket bon=row.bon %} {% endwith %} {% empty %} {% endfor %}
N° ID Numéro Montant net Remise Total Payé Montant payé Montant reste Type action Reçu Utilisateur Date de l'action Actions
{{ forloop.counter }} {{ item.id }} {{ item.numero_commande }} {{ item.total_sans_remise }} {{ item.remise }} {{ item.total }} {% if item.paye %}✅{% else %}❌{% endif %} {{ item.montant_paye }} {{ item.montant_reste }} {% if item.history_type == '+' %}Création {% elif item.history_type == '~' %}Modification {% elif item.history_type == '-' %}Suppression {% else %}—{% endif %} {% if ticket %} {% if ticket.fichier_pdf %} {{ ticket.numero }} {% else %} {{ ticket.numero }} {% endif %} {% else %} — {% endif %} {{ item.history_user.username|default:item.utilisateur.username|default:"—" }} {{ item.history_date|date:"d/m/Y H:i" }}
{% if item.paye and ticket %} {% if bon %} {% endif %} {% else %} — {% endif %}
Aucun historique pour la période sélectionnée.
{% if historique_rows %} {% include "mag/partials/_table_pager.html" %} {% endif %}
{% endblock main_content %} {% block extra_js %} {% include "mag/partials/_periode_filter_js.html" %} {% endblock extra_js %}