<!doctype html>
<html>
  <head>
    <style>
      @page then {
        size: a4 landscape;
        @frame {
          margin: 2cm 1cm;
        }
        @frame footer {
          -pdf-frame-content: footer;
          bottom: 0cm;
          height: 0.5cm;
        }
      }
      #content td {
        text-align: center;
      }
    </style>
  </head>
  <body>
    <div id="title">Bordereau des actes par code de gestion</div>
    <div id="date">
      <div>
        Édité le {{ now|date:"d/m/Y" }} à {{ now|time:"H:i:s" }}
      </div>
    </div>
    <div id="header-box">
      <div id="payee-header">
          <table style="padding: 3px; border: 0.5px solid black; height: 5cm;">
            <tr style="padding-top: 3px; padding-bottom: 2px; line-height: 50%; background-color: #EEEEEE; margin-bottom: 3cm"><td> Établissement</td></tr>
            <tr><td style="height: 5cm; display: block;">
            {% block payee %}
            {{ service.name }} de SAINT-ETIENNE</br>
            66/68, RUE MARENGO</br>
            42000 SAINT-ETIENNE</br>
            Tél.: 04 77 92 05 70</br>
            </br>
            Période du {{ start_date|date:"d/m/Y" }} au {{ end_date|date:"d/m/Y" }}</br>
            </br>
            Nombre de dossiers : {{ total_files }}</br>
            Nombre d'actes : {{ total_acts }}</br>
            </br>
            </br>
            </br>
            {% endblock %}
        </td></tr>
        </table>
      </div>
    <div id="content">
      <div style="border: 0.5px solid black; padding-top: 2px; padding-bottom: 3px; line-height: 50%;">
      <pdf:nexttemplate name="then"/>
      <table>
          <thead style="border: none;">
            <tr class="batch-columns-header" style="background-color: #EEEEEE;">
              <td>Code gestion</td>
              <td>Libellé</td>
              <td>Nombre d'actes</td>
              <td>Nombre de dossiers</td>
            </tr>
          </thead>
          <tbody class="batch-content" style="border: none;">
            {% for mc in list_management_codes %}
            <tr>
              <td>{{ mc.code }}</td>
              <td>{{ mc.title }}</td>
              <td>{{ mc.nb_acts }}</td>
              <td>{{ mc.nb_files }}</td>
            </tr>
            {% endfor %}
          </tbody>
      </table>
    <div id="footer">
      Bordereau des actes par code de gestion page <pdf:pagenumber/>
    </div>
  </body>
</html>
