{% for cat in categorie %} {% if cat.id not in [16,34] %} {% if section is defined and section == cat | replace({' ': '_'}) %} {% set class = "" %} {% else %} {% set class = 'hide' %} {% endif %}
{% if cat.icone != null %} {% endif %}

{{ cat.getLibelle() }} ({{ cat.getComposants()|length }})

Nombre de {{ cat }} : {{ cat.sumQuantiteCompo() }}
Montant du stock : {{ cat.prixStock() }} €
Image
{% set url = 'arrow-down.svg' %} {% set tmp = 'ASC' %} {% if sort == 'marque' %} {% if order == 'ASC' %} {% set tmp = 'DESC' %} {% set url = 'arrow-down-fill.svg' %} {% else %} {% set tmp = 'ASC' %} {% set url = 'arrow-up-fill.svg' %} {% endif %} {% endif %} Marque {% set catName = cat.getLibelle() | replace({' ':'_'}) %}
{% set url = 'arrow-down.svg' %} {% if sort == 'model' %} {% if order == 'ASC' %} {% set tmp = 'DESC' %} {% set url = 'arrow-down-fill.svg' %} {% else %} {% set tmp = 'ASC' %} {% set url = 'arrow-up-fill.svg' %} {% endif %} {% endif %} Modele
{% set url = 'arrow-down.svg' %} {% if sort == 'specs' %} {% if order == 'ASC' %} {% set tmp = 'DESC' %} {% set url = 'arrow-down-fill.svg' %} {% else %} {% set tmp = 'ASC' %} {% set url = 'arrow-up-fill.svg' %} {% endif %} {% endif %} Specs
EAN
{% set url = 'arrow-down.svg' %} {% if sort == 'prix' %} {% if order == 'ASC' %} {% set tmp = 'DESC' %} {% set url = 'arrow-down-fill.svg' %} {% else %} {% set tmp = 'ASC' %} {% set url = 'arrow-up-fill.svg' %} {% endif %} {% endif %} Prix
Fiche
{% set url = 'arrow-down.svg' %} {% if sort == 'quantite' %} {% if order == 'ASC' %} {% set tmp = 'DESC' %} {% set url = 'arrow-down-fill.svg' %} {% else %} {% set tmp = 'ASC' %} {% set url = 'arrow-up-fill.svg' %} {% endif %} {% endif %} Quantité
Modifier la quantité
{% for composant in cat.getComposantsOrderBy(sort | default('quantite'),order | default('DESC')) %}
Modifier
{% if composant.id in compoCount | keys %} {% set count = compoCount[composant.id] %} {% if count > starColor['yellow'] %} {% set class = 'text-warning' %} {% elseif count > starColor['blue'] %} {% set class = 'text-primary' %} {% elseif count > starColor['green'] %} {% set class = 'text-success' %} {% endif %} {% else %} {% set count = '' %} {% set class = 'text-secondary' %} {% endif %}
{{ count | default('') }}
{% if composant.hasImage() %} {% else %} {% endif %}
{{ composant.marque }}
{% include "stock/component/input.html.twig" with {'id' : 'editMarque_'~composant.id , 'input_value' : composant.marque, 'function' : 'updateMarque("'~composant.id~'","'~path('stock.compo.edit')~'")'} %}
{{ composant.model }}
{% include "stock/component/input.html.twig" with {'id' : 'editModele_'~composant.id , 'input_value' : composant.model, 'function' : 'updateModele("'~composant.id~'","'~path('stock.compo.edit')~'")'} %}
{{ composant.specs }}
{% include "stock/component/input.html.twig" with {'id' : 'editSpecs_'~composant.id , 'input_value' : composant.specs, 'function' : 'updateSpecs("'~composant.id~'","'~path('stock.compo.edit')~'")'} %}
{{ composant.isbn }}
{% include "stock/component/input.html.twig" with {'id' : 'editEAN_'~ composant.id , 'input_value' : composant.isbn, 'function' : 'updateEAN("'~composant.id~'","'~path('stock.compo.edit')~'")'} %}
{{ composant.prix }}
{% include "stock/component/input.html.twig" with {'id' : 'editPrix_'~composant.id , 'input_value' : composant.prix, 'function' : 'updatePrix("'~composant.id~'","'~path('stock.compo.edit')~'")'} %}
{% if composant.hasFiche() %} fiche {% endif %}
{% if composant.quantite > limiteQteCompo.value %} {% set warning = 'success text-white' %} {% elseif composant.quantite > 0 %} {% set warning = 'warning' %} {% else %} {% set warning = 'danger text-white' %} {% endif %} {{ composant.quantite }}
moins 0 plus
{% endfor %}
{% endif %} {% endfor %}