Ver código fonte

[Backend] Produits : stock dans liste

feature/export_comptable
Guillaume 4 anos atrás
pai
commit
b29c91fad0
1 arquivos alterados com 19 adições e 4 exclusões
  1. +19
    -4
      ShopBundle/Resources/views/backend/default/list-fields/field_product_family_available_quantity.html.twig

+ 19
- 4
ShopBundle/Resources/views/backend/default/list-fields/field_product_family_available_quantity.html.twig Ver arquivo

@@ -1,7 +1,22 @@
{% if value is defined and value is not null %}
{% if item.getBehaviorPrice() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE") %}
{{ value }} pièce{% if value > 1 %}s{% endif %}
{% elseif item.getBehaviorPrice() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT") %}
{{ value }} {{ item.getUnit().getUnit() }}
{% if value > 0 %}
{% set badge_class = 'badge-success' %}
{% else %}
{% set badge_class = 'badge-danger' %}
{% endif %}
<span class="badge {{ badge_class }}">
{% if item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE") %}
{{ value }} {{ item.getUnit().getUnit() }}
{% elseif item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY") %}
{{ value }} pièce{% if value > 1 %}s{% endif %}
{% elseif item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT") %}
{{ item.getAvailableQuantityInherited() }} pièce{% if value > 1 %}s{% endif %} (déclinaisons)
{% endif %}
</span>
{% else %}
{% if item.getBehaviorCountStock() == constant("Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_UNLIMITED") %}
<span class="badge badge-success">Illimité</span>
{% else %}
<span class="badge badge-danger">Pas de stock</span>
{% endif %}
{% endif %}

Carregando…
Cancelar
Salvar