{% extends 'layouts/authenticated.html.twig' %} {% block page_title %}Rapport Stock{% endblock %} {% block content %}

Rapport Stock

État des stocks et alertes

{# KPIs #}
Produits actifs
{{ report.productStats.total|default(0) }}
Valeur totale stock
{{ report.stockValuation.totalValue|default('0')|number_format(0, ',', ' ') }}
{{ settings.currencySymbol }} — {{ report.stockValuation.totalUnits|default(0) }} unités
Stock bas
{{ report.lowStockProducts|length }}
seuil: {{ report.settings.lowStockThreshold }}
Ruptures
{{ report.outOfStockProducts|length }}
{# Movement stats #} {% if report.movementStats|length > 0 %}

Mouvements de stock

{% for stat in report.movementStats %}
{{ stat.count }}
{{ stat.type|replace({'_': ' '}) }}
{{ stat.totalQuantity }} unités
{% endfor %}
{% endif %}
{# Out of stock #}

Ruptures de stock ({{ report.outOfStockProducts|length }})

{% if report.outOfStockProducts|length > 0 %}
{% for product in report.outOfStockProducts|slice(0, 15) %}
{{ product.name }}
{{ product.sku }}
{{ product.currentStock }}
{% endfor %}
{% else %}

Aucune rupture

{% endif %}
{# Critical + Low stock #}

Stock critique & bas ({{ report.criticalStockProducts|length + report.lowStockProducts|length }})

{% set allLow = report.criticalStockProducts|merge(report.lowStockProducts) %} {% if allLow|length > 0 %}
{% for product in allLow|slice(0, 15) %}
{{ product.name }}
{{ product.sku }}
{{ product.currentStock }}
{% endfor %}
{% else %}

Stock OK

{% endif %}
{% endblock %}