templates/manager/stock/forecasting/_forecasting-tbody.html.twig line 1

Open in your IDE?
  1. <tbody>
  2. {% if stocks is defined %}
  3.     {% for stock in stocks %}
  4.         {% if stock.quantityMovement != 0 %}
  5.             <tr class="{% if loop.first %}table-row-big {% endif %}{% if stock.quantity <= paper.quantityMin %}table-danger{% endif %}">
  6.                 <td>
  7.                 {% if loop.first %}
  8.                     <i class="far fa-calendar"></i>
  9.                 {% elseif stock.quantityMovement > 0 %}
  10.                     <i class="fa fa-arrow-right text-success"></i>
  11.                 {% else %}
  12.                     <i class="fa fa-arrow-left text-danger"></i>
  13.                 {% endif %}
  14.                 </td>
  15.                 <td>{{ stock.createdAt|date('d/m/Y') }}</td>
  16.                 <td>{% if not loop.first %}{% include "manager/stock/forecasting/_forecasting-label.html.twig" %}{% endif %}</td>
  17.                 <td class="text-end">{% if not loop.first %}{% if stock.quantityMovement > 0 %}+{% endif %}{{ stock.quantityMovement }}kg{% endif %}</td>
  18.                 <td class="text-end {% if stock.quantityTmp <= paper.quantityMin %}text-danger{% endif %}">{% if loop.first %}{{ stock.quantityPrevious }}{% else %}{{ stock.quantityTmp }}{% endif %}kg</td>
  19.                 <td>{% if not loop.first %}{{ stock.comment }}{% endif %}</td>
  20.                 <td class="text-end">
  21.                     {% if not loop.first %}
  22.                         <button class="btn btn-light btn-sm text-primary" data-bs-toggle="modal" data-bs-target="#forecastingEditModal" data-stock="{{ stock.id }}" data-type="{{ stock.type }}" data-url="{{path('stock_forecasting_edit', { id: paper.id })}}"><i class="fa fa-pen"></i></button>
  23.                     {% endif %}
  24.                 </td>
  25.             </tr>
  26.         {% endif %}
  27.     {% endfor %}
  28.     {% if hide_today == false and stocks|length or hide_today == false and stockOrders|length %}
  29.         <tr class="table-row-big" style="background: #eaeaea;">
  30.             <td><i class="far fa-calendar"></i></td>
  31.             <td>Aujourd'hui</td>
  32.             <td colspan="2"></td>
  33.             <td class="text-end"><b>{{paper.quantity}}kg</b></td>
  34.             <td colspan="2"></td>
  35.         </tr>
  36.     {% endif %}
  37. {% endif %}
  38. {% for stock in stockOrders %}
  39.     <tr class="{% if stock.archived %}table-warning{% elseif stock.quantity <= paper.quantityMin %}table-danger{% endif %}">
  40.         <td>
  41.             {% if stock.quantityMovement > 0 %}
  42.                 <i class="fa fa-arrow-up text-success"></i>
  43.             {% else %}
  44.                 <i class="fa fa-arrow-down text-danger"></i>
  45.             {% endif %}
  46.         </td>
  47.         <td>
  48.             {{stock.stockDate|date('d/m/Y H:i')}}
  49.             {% if stock.archived %}<span class="badge bg-warning text-dark">archivĂ©</span>{% endif %}
  50.             {% if stock.stockDate|date('U') < 'now'|date('U') %}<span class="badge bg-warning text-dark">retardĂ©</span>{% endif %}
  51.         </td>
  52.         <td>{% include "manager/stock/forecasting/_forecasting-label.html.twig" %}</td>
  53.         <td  class="text-end">{% if stock.quantityMovement > 0 %}+{% endif %}{{ stock.quantityMovement }}kg</td>
  54.         <td class="text-end {% if stock.quantityTmp <= paper.quantityMin %}text-danger{% endif %}">{% if stock.archived == false %}{{ stock.quantityTmp }}kg{% endif %}</td>
  55.         {% if hide_today == null %}<td>{{ stock.comment }}</td>{% endif %}
  56.         <td class="text-end">
  57.             <button class="btn btn-light btn-sm text-primary" data-bs-toggle="modal" data-bs-target="#forecastingEditModal" data-paper="{{ paper.id }}" data-stock="{{ stock.id }}" data-type="{{ stock.type }}" data-url="{{path('stock_forecasting_edit', { id: paper.id })}}"><i class="fa fa-pen"></i></button>
  58.         </td>
  59.     </tr>
  60. {% endfor %}
  61. {% if stocks is not defined and stockOrders is empty or stocks is defined and stocks is empty and stockOrders is empty %}
  62.     <tr>
  63.         <td colspan="100%">Aucun mouvement de stock</td>
  64.     </tr>
  65. {% endif %}
  66. </tbody>