templates/order/_list.html.twig line 1

Open in your IDE?
  1. {%  if orders|length <=0 %}
  2.     <div class="container">
  3.         <div class="alert alert-info">
  4.             {{ "Vous n'avez aucune commande passée."|trans }}
  5.         </div>
  6.     </div>
  7. {%  else %}
  8. <table class="table table-bordered table-striped">
  9.     <thead>
  10.     <tr>
  11.         {# <th>Id</th>#}
  12.         {% if is_granted('ROLE_SUPER_ADMIN') %}
  13.             <th>Client</th>
  14.             <th>{{ "Shop"|trans }}</th>
  15.         {%  endif %}
  16.         {% if is_granted('ROLE_ADMIN') %}
  17.             <th>{{ "User"|trans }}</th>
  18.             <th>Bak2 ref</th>
  19.         {%  endif %}
  20.         <th>{{ "Reference"|trans }}</th>
  21.         <th>{{ "Date"|trans }}</th>
  22.         <th>{{ "Nb products"|trans }}</th>
  23.         <th>{{ "Amount"|trans }} {{ "HTVA"|trans }}</th>
  24.         <th>{{ "Amount"|trans }} {{ "TTC"|trans }}</th>
  25.         <th>{{ "Payment"|trans }}</th>
  26.         <th>{{ "Status"|trans }}</th>
  27.         <th>{{ "Shipping"|trans }} ref</th>
  28.         <th>{{ "Order"|trans }}</th>
  29.         <th>{{ "Invoice"|trans }}</th>
  30.         {% if is_granted('ROLE_SUPER_ADMIN') %}
  31.         <th></th>
  32.         {%  endif %}
  33.     </tr>
  34.     </thead>
  35.     <tbody>
  36.     {% for order in orders %}
  37.         <tr>
  38.             {#<td>{{ order.id }}</td>#}
  39.             {% if is_granted('ROLE_SUPER_ADMIN') %}
  40.                 <td>{{ order.user.company }}</td>
  41.                 <td>{{ order.user.shop }}</td>
  42.             {%  endif %}
  43.             {% if is_granted('ROLE_ADMIN') %}
  44.                 <td>{{ order.user }}</td>
  45.                 <td>{{ order.bak2Reference }}</td>
  46.             {%  endif %}
  47.             <td><a href="{{ path('app_order_show', {'id': order.id}) }}">{{ order.reference }}</a></td>
  48.             <td>{{ order.date|date('Y-m-d') }}</td>
  49.             <td>{{ order.nbProducts }}</td>
  50.             {% set total = order.amountHt + order.deliveryHt %}
  51.             <td>{{ (total/100)|format_number({fraction_digit: 2}) }}</td>
  52.             <td>{{ ((total*(1+(order.shop.country=='es'?21:20)/100))/100)|format_number({fraction_digit: 2}) }}</td>
  53.             <td>{{ order.payment }}</td>
  54.             <td><span class="badge" style="background:{{ order.status.color }}">{{ order.status }}</span></td>
  55.             <td>{{ order.shippingNumber }}</td>
  56.             <td class="text-center"><a href="{{ path('app_order_pdf_order',{'id':order.id}) }}"><i class="bi bi-file-pdf fs-2 text-danger"></i></a></td>
  57.             <td class="text-center">{% if order.invoiceFilename %}<a href="{{ path('app_order_pdf_invoice',{'id':order.id}) }}" target="_blank"><i class="bi bi-file-pdf fs-2 text-danger"></i></a>{%  endif %}</td>
  58.             {% if is_granted('ROLE_SUPER_ADMIN') %}
  59.                 <td>
  60.                     <a href="{{ path('app_order_edit', {'id': order.id}) }}">edit</a>
  61.                 </td>
  62.             {%  endif %}
  63.         </tr>
  64.     {% else %}
  65.         <tr>
  66.             <td colspan="8">{{ "no records found"|trans }}</td>
  67.         </tr>
  68.     {% endfor %}
  69.     </tbody>
  70. </table>
  71.     <div class="d-flex justify-content-between">
  72.         <div></div>
  73.         <div class="navigation">
  74.             {{ knp_pagination_render(orders) }}
  75.         </div>
  76.     </div>
  77. {%  endif %}