{% extends '@admin/base.html.twig' %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block subheader %}

Inventaire {{ inventory.code }}

Consultation detaillee des lignes d'inventaire
Liste inventaires
Historique des modifications
{{ inventoryHistories|length }} element{{ inventoryHistories|length > 1 ? 's' : '' }}
{% if inventoryHistories is empty %}
Aucun historique pour le moment.
{% else %}
{% set currentDay = '' %}
{% for history in inventoryHistories %} {% set day = history.createdAt|date('d/m/Y') %} {% if day != currentDay %} {% set currentDay = day %}
{{ currentDay }}
{% endif %}
{{ history.type|replace({'unvalidate':'annulation','validate':'validation','update':'modification','create':'creation'})|capitalize }} {{ history.createdAt|date('H:i') }} par {{ history.user ? (history.user.fullName ?: history.user.username ?: ('#' ~ history.user.id)) : 'Systeme' }}
{{ history.message }}
{% endfor %}
{% endif %}
{% endblock %} {% block breadcrumb %}{% endblock %} {% block bodycontent %}
Filtres
{% set _rawStatus = (inventory.status ?: 'draft')|lower|trim %} {% set _isDraft = _rawStatus in ['', 'draft', 'brouillon', 'brouillan', 'broullion'] %} {% set _isValidated = _rawStatus in ['validated', 'valide', 'validé'] %}
Statut: {{ _isValidated ? 'Valide' : 'Brouillon' }} Cree le: {{ inventory.createdAt ? inventory.createdAt|date('d/m/Y H:i') : '' }} Cree par: {{ createdByName|default('-') }} {% if inventory.validatedAt %} Valide le: {{ inventory.validatedAt|date('d/m/Y H:i') }} {% endif %} {% if inventory.validatedAt %} Valide par: {{ validatedByName|default('-') }} {% endif %} Articles: {{ inventory.itemsCount }} Ecart total: {{ inventory.totalGap > 0 ? '+' ~ inventory.totalGap : inventory.totalGap }} {% if inventory.storehouse %} Entrepot: {{ inventory.storehouse }} {% endif %}
{% if _isDraft %} Modifier {% endif %} {% if _isDraft %}
{% endif %} {% if _isValidated and is_granted('ROLE_SUPER_ADMIN') %}
{% endif %}
{% if inventory.note %}
Note: {{ inventory.note }}
{% endif %}
{% set seenProducts = [] %} {% for l in inventory.lines %} {% set pid = l.produitId ?: ('na-' ~ l.id) %} {% set prodData = productsMap[l.produitId]|default(null) %} {% if pid not in seenProducts %} {% set seenProducts = seenProducts|merge([pid]) %} {% set productLines = inventory.lines|filter(x => (x.produitId ?: ('na-' ~ x.id)) == pid) %} {% set pQtStock = 0 %} {% set pQtReserved = 0 %} {% set pQtCounted = 0 %} {% set hasCorrection = false %} {% for pl in productLines %} {% set pQtStock = pQtStock + (pl.qtTheoretical|default(0)) %} {% set pQtReserved = pQtReserved + (pl.qtReserved|default(0)) %} {% set pQtCounted = pQtCounted + (pl.qtCounted|default(0)) %} {% if (pl.qtGap|default(0)) != 0 %} {% set hasCorrection = true %} {% endif %} {% endfor %} {% set pQtAvailable = pQtStock - pQtReserved %} {% set pQtGap = pQtCounted - pQtStock %} {% set prodImgName = (prodData and prodData.image) ? prodData.image : 'no-image-50px.png' %} {% set prodImgFile = (prodImgName starts with 'http' or prodImgName starts with '/') ? prodImgName : (prodImgName|split('/')|last) %} {% set prodImgSrc = (prodImgFile starts with 'http' or prodImgFile starts with '/') ? prodImgFile : asset('images/' ~ prodImgFile) %} {% set prodImgUploadSrc = (prodImgFile starts with 'http' or prodImgFile starts with '/') ? prodImgFile : asset('uploads/images/' ~ prodImgFile) %} {% endif %} {% else %} {% endfor %}
Photo Reference Produit / Declinaison Entrepot Theorique Reserve Compte Ecart
{% if l.produitId %} {{ (prodData and prodData.reference) ? prodData.reference : l.reference }} {% else %} {{ (prodData and prodData.reference) ? prodData.reference : l.reference }} {% endif %}
{{ (prodData and prodData.name) ? prodData.name : ('Produit #' ~ (l.produitId ?: '-')) }}
{{ productLines|length }} ligne(s) de stock
{{ hasCorrection ? 'Corrige' : 'Non corrige' }}
{{ l.storehouse ?: 'Principal' }}
Stock: {{ pQtStock }} Reserve: {{ pQtReserved }} Dispo: {{ pQtAvailable }} Compte: {{ pQtCounted }} Ecart: {{ pQtGap > 0 ? '+' ~ pQtGap : pQtGap }}
{% for pl in productLines %} {% set plGap = pl.qtGap is not null ? pl.qtGap : ((pl.qtCounted|default(0)) - (pl.qtTheoretical|default(0))) %} {% set isCorrected = plGap != 0 %} {% set decliData = declinationsMap[pl.declinationProduitId]|default(null) %} {% set decliImgName = (decliData and decliData.image) ? decliData.image : ((prodData and prodData.image) ? prodData.image : 'no-image-50px.png') %} {% set decliImgFile = (decliImgName starts with 'http' or decliImgName starts with '/') ? decliImgName : (decliImgName|split('/')|last) %} {% set decliImgSrc = (decliImgFile starts with 'http' or decliImgFile starts with '/') ? decliImgFile : asset('images/' ~ decliImgFile) %} {% set decliImgUploadSrc = (decliImgFile starts with 'http' or decliImgFile starts with '/') ? decliImgFile : asset('uploads/images/' ~ decliImgFile) %} {% endfor %}
{% if pl.declinationProduitId %} {{ pl.reference }} {% else %} {{ pl.reference }} {% endif %}
{{ pl.labelName }}
{{ isCorrected ? 'Corrige' : 'Non corrige' }}
{{ pl.storehouse ?: 'Principal' }} Stock: {{ pl.qtTheoretical }} Reserve: {{ pl.qtReserved }} Compte: {{ pl.qtCounted }} {{ plGap > 0 ? '+' ~ plGap : plGap }}
Aucune ligne.
Historique des modifications
{{ inventoryHistories|length }} element{{ inventoryHistories|length > 1 ? 's' : '' }}
{% if inventoryHistories is empty %}
Aucun historique pour le moment.
{% else %}
{% set currentDay = '' %}
{% for history in inventoryHistories %} {% set day = history.createdAt|date('d/m/Y') %} {% if day != currentDay %} {% set currentDay = day %}
{{ currentDay }}
{% endif %}
{{ history.type|replace({'unvalidate':'annulation','validate':'validation','update':'modification','create':'creation'})|capitalize }} {{ history.createdAt|date('H:i') }} par {{ history.user ? (history.user.fullName ?: history.user.username ?: ('#' ~ history.user.id)) : 'Systeme' }}
{{ history.message }}
{% endfor %}
{% endif %}
{% endblock %} {% block js %} {{ parent() }} {% endblock %}