{% extends 'layouts/authenticated.html.twig' %} {% block page_title %}Stock POS{% endblock %} {% block content %}
{# Header #}
{# Stats cards #}
{{ valuation.totalProducts|default(0) }}
Produits en stock
{{ valuation.totalUnits|default(0)|number_format(0, ',', ' ') }}
Unites totales
{{ valuation.totalValue|default(0)|number_format(0, ',', ' ') }}
Valeur ({{ settings.currencySymbol }})
{# Filtres #}
Reset
{# Liste des produits #} {% if products|length > 0 %} {# Vue desktop: table #} {# Vue mobile: cards #}
{% for product in products %} {% set stockStatus = product.getStockStatus(settings.lowStockThreshold, settings.criticalStockThreshold) %} {% set statusColors = {'out': 'red', 'critical': 'orange', 'low': 'yellow', 'ok': 'green', 'service': 'gray'} %} {% set statusColor = statusColors[stockStatus]|default('gray') %}
{{ product.name }}
{{ product.sku }} {% if product.category %} {{ product.category.name }} {% endif %}
{{ product.currentStock }}
{% if stockStatus == 'out' %} Rupture {% elseif stockStatus == 'critical' %} Critique {% elseif stockStatus == 'low' %} Bas {% else %} OK {% endif %}
{% if product.minStock is not null %} Min: {{ product.minStock }} {% endif %} {% if product.costPrice %} {{ product.costPrice|number_format(0, ',', ' ') }} {{ settings.currencySymbol }} {{ (product.currentStock * product.costPrice)|number_format(0, ',', ' ') }} {{ settings.currencySymbol }} {% endif %}
{# Actions bar #}
{% endfor %}
{{ knp_pagination_render(products) }}
{% else %}

Aucun produit en stock

Commencez par ajouter des produits au catalogue.

Creer un produit
{% endif %}
{% endblock %}