{% extends 'base.html' %} {% block title %}Statistiques{% endblock %} {% block content %}
CA par client
{% if by_client %} {% set total_rev = by_client | sum(attribute='revenue') %} {% for c in by_client %} {% endfor %}
ClientCommandesMarge moy.CA total
{{ c.name }} {{ c.jobs }} {{ c.avg_margin }}% {{ c.revenue }} € {% if total_rev > 0 %}
{% endif %}
{% else %}
Aucune donnée disponible.
{% endif %}
CA par mois (12 derniers)
{% if by_month %} {% set max_rev = by_month | map(attribute='revenue') | max %} {% for m in by_month %} {% endfor %}
MoisCmdsCA
{{ m.month }} {{ m.jobs }} {{ m.revenue }} € {% if max_rev > 0 %}
{% endif %}
{% else %}
Aucune donnée disponible.
{% endif %}
Filament gaspillé par matière
{% if waste_by_material %} {% set max_waste = waste_by_material | map(attribute='wasted_g') | max %} {% for m in waste_by_material %} {% endfor %}
Matière Gaspillé Stock restant
{% if m.color %} {% endif %} {{ m.name }} {% if m.type %}{{ m.type }}{% endif %} {{ m.wasted_g }} g {% if max_waste > 0 %}
{% endif %}
{{ m.stock_g }} g
{% else %}
Aucun gaspillage enregistré.
{% endif %}
Taux d'échec par imprimante
{% if failure_by_printer %} {% for p in failure_by_printer %} {% set rate = (p.failed_slots / p.total_slots * 100) | round(1) %} {% endfor %}
Imprimante Taux Gaspillé
{{ p.name }}
{{ p.failed_slots }}/{{ p.total_slots }} créneaux
{{ rate }}% {{ p.wasted_g }} g
{% else %}
Aucun échec enregistré.
{% endif %}
{% endblock %}