templates/rapport/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{% endblock %}
  3. {% block body %}
  4. <style>
  5.     body{
  6.         font-family: Poppins
  7.     }
  8.     .main-content{
  9.         background: #fff;
  10.         height: auto;
  11.     }
  12.     .bouttonfilltre{
  13.         margin-top: 30px;
  14.         background: #C64864;
  15.         color: #fff;
  16.     }
  17.     .page-content {
  18.         padding: 0px 10px;
  19.     }
  20. </style>
  21.     {%  if app.user.stringRole == 'Admin' %}
  22.     {{ form_start(filterForm) }}
  23.     <div class="row" style="
  24.     background: #c3e2e2;
  25.     border: 1px dotted;
  26.     padding: 32px;
  27. ">
  28.         <div class="col-4">
  29.     {{ form_row(filterForm.startDate, {'attr': {'class': 'form-control'}}) }}
  30.         </div>
  31.         <div class="col-4">
  32.     {{ form_row(filterForm.endDate, {'attr': {'class': 'form-control'}}) }}
  33.         </div>
  34.         <div class="col-4">
  35.     {% if filterForm.user is defined %}
  36.         {{ form_row(filterForm.user, {'attr': {'class': 'form-control'}}) }}
  37.     {% endif %}
  38.         </div>
  39.         <div class="col-12" style="text-align: center">
  40.             {{ form_row(filterForm.filter, {'attr': {'class': 'form-control bouttonfilltre'}})}}
  41.         </div>
  42.     </div>
  43.         {{ form_end(filterForm) }}
  44.     {% elseif app.user.stringRole != 'Admin'   %}
  45.         {{ form_start(filterForm) }}
  46.         <div class="row" style="
  47.     background: #c3e2e2;
  48.     border: 1px dotted;
  49.     padding: 32px;
  50. ">
  51.             <div class="col-6">
  52.                 {{ form_row(filterForm.startDate, {'attr': {'class': 'form-control'}}) }}
  53.             </div>
  54.             <div class="col-6">
  55.                 {{ form_row(filterForm.endDate, {'attr': {'class': 'form-control'}}) }}
  56.             </div>
  57.             <div class="col-6" style="text-align: center">
  58.                 {{ form_row(filterForm.filter, {'attr': {'class': 'form-control bouttonfilltre'}})}}
  59.             </div>
  60.         </div>
  61.         {{ form_end(filterForm) }}
  62.     {% endif %}
  63.     <h2 style=" font-family: Poppins; text-align: center ; color: #1bbc9b;margin: 30px 0px">Rapports pour {{ monthName }}</h2>
  64.               {%  if app.user.stringRole == 'Admin'%}
  65.                   <div class="row">
  66.                       <div class="col-lg-6">
  67.                           <div class="card">
  68.                               <div class="card-header" style="background: #8d2a8a ; color: #fff ; text-align: center">Total des commandes  </div>
  69.                               <div class="card-body">
  70.                                   <h4 class="mb-0 text-center text-dark">
  71.                                       {{ totalOrdersAmount }} DH
  72.                                   </h4>
  73.                               </div>
  74.                           </div>
  75.                       </div><!-- end col -->
  76.                       <div class="col-lg-6">
  77.                           <div class="card">
  78.                               <div class="card-header" style="background: #78DEC7; text-align: center">Total des commissions</div>
  79.                               <div class="card-body">
  80.                                   <h4 class="mb-0 text-center text-dark"> {{ totalCommissionsAmount }} DH</h4>
  81.                               </div>
  82.                           </div>
  83.                       </div><!-- end col -->
  84.                   </div>
  85.     {% endif %}
  86.     {% if orders is not empty %}
  87.         <h5 style="color: #fff  ;  background:#028080 ; padding: 10px">1 : Total de mes commandes  : {{ totalAmount }} DH</h5> {# Affichez le total ici #}
  88.         <div class="table-bordered">
  89.         <table class="table">
  90.             <thead>
  91.             <tr>
  92.                 <th>N° commande</th>
  93.                 <th>Montant</th>
  94.                 <th>Date</th>
  95.             </tr>
  96.             </thead>
  97.             <tbody>
  98.             {% for order in orders %}
  99.                 <tr>
  100.                     <td>{{ order.numerocommande }}</td>
  101.                     <td>{{ order.total }}</td>
  102.                     <td>{{ order.date|date('Y-m-d') }}</td>
  103.                 </tr>
  104.             {% endfor %}
  105.             </tbody>
  106.         </table>
  107.     {% else %}
  108.         <p>Aucune commande trouvée pour les critères spécifiés.</p>
  109.     {% endif %}
  110.     </div>
  111. <h5 style="color: #fff ; margin-top: 30px ; background:#028080  ; padding: 10px">2 : Récapitulatif des commandes et des commissions de mon réseau </h5>
  112.     <table class="table" id="table">
  113.         <thead>
  114.         <tr>
  115.             <th>Génération</th>
  116.             <th>Total Commandes (Dh)</th>
  117.             <th>Total Commissions (Dh)</th>
  118.         </tr>
  119.         </thead>
  120.         <tbody>
  121.         {% set totalCommissions = 0 %}
  122.         {% set totalOrders = 0 %}
  123.         {% for data in commissionsByLevel %}
  124.             {% set orderAmount = totalOrdersByLevel[data.level]|default(0) %}
  125.             {% set commissionAmount = data.totalCommissions|default(0) %}
  126.             {% set totalCommissions = totalCommissions + commissionAmount %}
  127.             {% set totalOrders = totalOrders + orderAmount %}
  128.             <tr>
  129.                 <td>G {{ data.level }}</td>
  130.                 <td>{{ orderAmount }}</td>
  131.                 <td>{{ commissionAmount }}</td>
  132.             </tr>
  133.         {% endfor %}
  134.         <tr  >
  135.             <th style="background: #ff00ff ; color: #ffffff ; font-weight: 800;"> Total</th>
  136.             <td style="background: #ff00ff ; color: #ffffff ; font-weight: 800;">{{ totalOrders }} DH </td>
  137.             <td style="background: #ff00ff ; color: #ffffff ; font-weight: 800;">{{ totalCommissions }} DH </td>
  138.         </tr>
  139.         </tbody>
  140.     </table>
  141.     <h5 style="color: #fff ; margin-top: 30px ; background:#028080 ; padding: 10px">3 : Détail   des commandes et des commissions de mon réseau </h5>
  142.     {% for generation, details in detailsByGeneration %}
  143.         <h5 style="    background: aquamarine;
  144.     padding: 5px;">Génération {{ generation }}</h3>
  145.         <div style="overflow-x: auto; /* Active le défilement horizontal si le contenu déborde */
  146.     width: 100%;
  147.     margin-bottom: 100px/* Vo">
  148.         <table class="table" id="tableo" >
  149.             <thead>
  150.             <tr>
  151.                 <th>Agent</th>
  152.                 <th>Code</th>
  153.                 <th>N°  Commande</th>
  154.                 <th>Mt Commande</th>
  155.                 <th>Commission</th>
  156.             </tr>
  157.             </thead>
  158.             <tbody>
  159.             {% for detail in details %}
  160.                 <tr>
  161.                     <td>{{ detail.userLastName }} {{ detail.userfirstname }}</td>
  162.                     <td>{{ detail.userMatricule }}</td>
  163.                     <td>{{ detail.orderNumber }}</td>
  164.                     <td>{{ detail.orderAmount }}</td>
  165.                     <td>{{ detail.commission }}</td>
  166.                 </tr>
  167.             {% else %}
  168.                 <tr>
  169.                     <td colspan="5">Aucune donnée disponible</td>
  170.                 </tr>
  171.             {% endfor %}
  172.             </tbody>
  173.         </table>
  174.         </div>
  175.     {% endfor %}
  176. {% endblock %}
  177. {% block javascripts %}
  178.     {{ parent() }}
  179.     <script type="text/javascript">
  180.         $(document).ready( function () {
  181.             $('#table')({
  182.                 scrollX: true,
  183.                 language: {
  184.                     url: '//cdn.datatables.net/plug-ins/1.10.20/i18n/French.json'
  185.                 }
  186.             });
  187.         } );
  188.     </script>
  189.     <script type="text/javascript">
  190.         $(document).ready( function () {
  191.             $('#tableo')({
  192.                 scrollX: true,
  193.                 language: {
  194.                     url: '//cdn.datatables.net/plug-ins/1.10.20/i18n/French.json'
  195.                 }
  196.             });
  197.         } );
  198.     </script>
  199. {% endblock %}