{% for cmd in commande %} {% set isOK = true %} {% if cmd.isBoutique() %} {% set id = 'BTQ_'~cmd.id %} {% endif %} {% if submenu is defined %} {% set warning = 'white' %} {% for item in cmd.contenu %} {% set ite = loop.index0 %} {% if item.isComposant() %} {% set qte = composant.find(item.article.id).quantite %} {% if qte >= item.quantite or (item.hasCommandeFournisseur() and item.commandeFournisseur.is('recu')) %} {% set warning = 'green' %} {% elseif item.hasCommandeFournisseur() and item.commandeFournisseur.is('order') %} pas {% set warning = 'warning' %} {% set isOK = false %} {% else %} {% set warning = 'danger' %} {% set isOK = false %} {% endif %} {% endif %} {% if item.isPc() == 16 %} {# item est une entity detail #} {% set SousProduit = item.getSousProduit()[ite] %} {% set pc = pcs.find(item.article.id) %} {% if pc.getCompoLimitant() is empty %} {% if pc.quantite <= 0 %} {% set warning = 'warning' %} {% set isOK = true %} {% else %} {% set warning = 'green' %} {% endif %} {% else %} {% if SousProduit.hasCommandeFournisseur() and SousProduit.commandeFournisseur.is('order') %} {% set warning = 'warning' %} {% set isOK = false %} {% elseif SousProduit.hasCommandeFournisseur() and SousProduit.quantite == 0 %} {% set warning = 'green' %} {% else %} {% set warning = 'danger' %} {% set isOK = false %} {% endif %} {% endif %} {% endif %} {% endfor %}
  
{% endif %}
{% if submenu is defined %}
{% if cmd.status.id in [1,37] %} {% endif %} {% set class ="" %} {% if cmd.hasLivraisons() %} {% set class ="active" %} {% endif %}
{% endif %}
{% if app.user.is('dev') %}
Voir
Supprimer
{% endif %}
{{ cmd.getFormattedDateOrder() }}
{{ cmd.temps }}
jours {% for item in cmd.contenu %} ({{ item.quantite }}) - {{ item.article }}
{% endfor %} {{ cmd.client }}
{{ cmd.numero }} {% if cmd.isLate() %}
En retard
{% endif %} {% if cmd.getDateLimiteExp() is empty %} N/C
{% else %} {{ cmd.getDateLimiteExp() }} {% endif %} {% if cmd.infos != null %} En attente
{{ cmd.infos }} {% else %} {{ cmd.status.libelle }} {% endif %} {% if cmd.isBoutique() %} Payé : {{ cmd.sumAccompte() }} €
Restant : {{ cmd.getTotalTTC() - cmd.sumAccompte() }} €
Total : {{ cmd.getTotalTTC() }} € {% endif %} {% if 'STOCK' in cmd.numero %} {% include "commande/commandeOption/stock.html.twig" with {cmd:cmd} %} {% elseif cmd.status.id == 6 %} {% include "commande/commandeOption/sav.html.twig" with {cmd:cmd} %} {% elseif cmd.status.id == 4 %} {% include "commande/commandeOption/cancel.html.twig" with {cmd:cmd} %} {% else %} {% include "commande/commandeOption/standard.html.twig" with {cmd:cmd,isOK : isOK} %} {% endif %} {% else %} Aucune commande dans cette section {% endfor %} {% set count = length / 100 %} {% set count = count|round(0,'floor') %} {% if count < 1 %} {% set count = 1 %} {% endif %} {% for i in 1.. count %} {{ i }} {% endfor %}