templates/pdf/ndf.html.twig line 1

Open in your IDE?
  1. {% if app_logo is not defined %}
  2.     {% set app_logo = societe.logo_path %}
  3. {%  endif %}
  4. <table>
  5.     <tr>
  6.         {% if format_ndf in ['by-id','by-projet-salarie-mois'] %}
  7.             {% set document = document_list[0] %}
  8.             {% set salarie = document.getSalarie %}
  9.             <td class="100p text-center" colspan="3"><strong>Note de frais de {{ salarie.getPrenomTiers }} {{ salarie.getNomTiers }}</strong></td>
  10.         {%  elseif format_ndf in ['by-mois'] %}
  11.             <td class="100p text-center" colspan="3"><strong>Note de frais de {{ periode }}</strong></td>
  12.         {%  elseif format_ndf in ['by-salarie-mois'] %}
  13.             {% set document = document_list[0] %}
  14.             {% set salarie = document.getSalarie %}
  15.             <td class="100p text-center" colspan="3"><strong>Note de frais de {{ salarie.getPrenomTiers }} {{ salarie.getNomTiers }} du {{ periode }}</strong></td>
  16.         {%  elseif format_ndf in ['by-projet'] %}
  17.             <td class="100p text-center" colspan="3"><strong>Note de frais du projet {{ projet }}</strong></td>
  18.         {%  endif %}
  19.     </tr>
  20.     <tr>
  21.         <td class="25p">
  22.             <table>
  23.                 <tr>
  24.                     <td>
  25.                         <img class="brand-logo" alt="stack admin logo" src="../assets/images/logo/{{ app_logo }}" height="80">
  26.                         <p style="padding-top: 30px">{{ societe.rue }} - {{ societe.code_postal }} {{ societe.ville }}</p>
  27.                         <p style="padding-top: -2px">{{ societe.telephone }}</p>
  28.                         <p style="padding-top: -2px">{{ societe.site_web }}</p>
  29.                     </td>
  30.                 </tr>
  31.             </table>
  32.         </td>
  33.         <td class="50p">
  34.             <table>
  35.                 {% if format_ndf in ['by-id','by-projet-salarie-mois'] %}
  36.                     {% set document = document_list[0] %}
  37.                     {% set salarie = document.getSalarie %}
  38.                     <tr>
  39.                         <td class="15p">Client :</td>
  40.                         <td class="66p">{{ document.getProjet.getSociete.getLibSociete }}</td>
  41.                     </tr>
  42.                     <tr>
  43.                         <td class="15p">Production :</td>
  44.                         <td class="66p">{{ document.getProjet.getNumProd }}</td>
  45.                     </tr>
  46.                     <tr>
  47.                         <td class="15p">Projet :</td>
  48.                         <td class="66p">{{ document.getProjet.getLibProjet }}</td>
  49.                     </tr>
  50.                     <tr>
  51.                         <td class="15p">Demandeur :</td>
  52.                         <td class="66p">{{ salarie.getPrenomTiers }} {{ salarie.getNomTiers }}</td>
  53.                     </tr>
  54.                     <tr>
  55.                         <td class="15p">Date :</td>
  56.                     </tr>
  57.                 {%  endif %}
  58.             </table>
  59.         </td>
  60.         <td class="25p">
  61.             <table>
  62.                 <tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr>
  63.                 <tr>
  64.                     <td class="50p"></td>
  65.                     <td class="50p text-right">Imprimer en 2 exemplaires</td>
  66.                 </tr>
  67.             </table>
  68.         </td>
  69.     </tr>
  70. </table>
  71. {% set tva_list = [0, 5.5, 10, 20] %}
  72. {% set totaux = {} %}
  73. {% set total_0 = 0 %}
  74. {% set total_55 = 0 %}
  75. {% set total_10 = 0 %}
  76. {% set total_20 = 0 %}
  77. {% set total_ht = 0 %}
  78. {% set total_tva = 0 %}
  79. {% set total_ttc = 0 %}
  80. {% set total_avance = 0 %}
  81. <table class="table-bordered font-size-small mt-50">
  82.     <thead>
  83.         <tr>
  84.             <th class="8p" rowspan="2">Date</th>
  85.             <th class="15p" rowspan="2">Désignation</th>
  86.             {# 7 th type #}
  87.             {% for type in type_list %}
  88.                 {% set totaux = totaux|merge({(type): 0}) %}
  89.                 <th class="5p text-center" rowspan="2">{{ type }}</th>
  90.             {% endfor %}
  91.             <th class="10p text-center" colspan="4">Montant TVA</th>
  92.             <th class="10p text-right" rowspan="2">Montant TTC</th>
  93.         </tr>
  94.         <tr>
  95.             {% for taux_tva in tva_list %}
  96.                 <th class="text-right">{{ taux_tva }}%</th>
  97.             {% endfor %}
  98.         </tr>
  99.     </thead>
  100.     <tbody>
  101.     {% for document in document_list %}
  102.         {% set ventilation_tva = {'A':0,'B':0,'C':0,'D':0} %}
  103.         {{ document.orderDocLigneByTauxTva() }}
  104.         <tr>
  105.             <td class="text-center" style="vertical-align: middle;">{{ document.getDateNdf|date('d/m/Y') }}</td>
  106.             <td class="">{{ document.libelle }}</td>
  107. {#            <td class="">{{ document.libelle }} - {{ ligne.getTauxTva * 100 }}%</td>#}
  108.             {% for row, ligne in document.getDocumentLignes %}
  109.                 {% if row == 0 %}
  110.                     {% for type in type_list %}
  111.                         {% if ligne.getLibelle == type %}
  112.                             {% set totaux = totaux|merge({(type): totaux[type] + document.getMontantHt}) %}
  113.                             <td class="text-center">{{ document.getMontantHt|format_euro }}</td>
  114.                         {% else %}
  115.                             <td class="text-center">{{ 0|format_euro }}</td>
  116.                         {% endif %}
  117.                     {% endfor %}
  118.                 {% endif %}
  119.                 {% for i in 'A'..'D' %}
  120.                     {% set lettre = '' %}
  121.                     {% if ligne.getTauxTva == 0 %}{% set lettre = 'A' %}{% endif %}
  122.                     {% if ligne.getTauxTva == 0.055 %}{% set lettre = 'B' %}{% endif %}
  123.                     {% if ligne.getTauxTva == 0.1 %}{% set lettre = 'C' %}{% endif %}
  124.                     {% if ligne.getTauxTva == 0.2 %}{% set lettre = 'D' %}{% endif %}
  125.                     {% if lettre == i %}
  126.                         {% set ventilation_tva = ventilation_tva|merge({(i): ventilation_tva[i] + ligne.getMontantTva}) %}
  127.                     {% endif %}
  128.                 {% endfor %}
  129.                 {% if ligne.getTauxTva == 0 %}{% set total_0 = total_0 + ligne.getMontantTva %}{% endif %}
  130.                 {% if ligne.getTauxTva == 0.055 %}{% set total_55 = total_55 + ligne.getMontantTva %}{% endif %}
  131.                 {% if ligne.getTauxTva == 0.1 %}{% set total_10 = total_10 + ligne.getMontantTva %}{% endif %}
  132.                 {% if ligne.getTauxTva == 0.2 %}{% set total_20 = total_20 + ligne.getMontantTva %}{% endif %}
  133.                 {% set total_ht = total_ht + ligne.getMontantHt %}
  134.                 {% set total_tva = total_tva + ligne.getMontantTva %}
  135.                 {% set total_ttc = total_ttc + (ligne.getMontantHt + ligne.getMontantTva) %}
  136.                 {% if ligne.getLibelle == 'Avance' %}
  137.                     {% set total_avance = total_avance + ligne.getPuht %}
  138.                 {% endif %}
  139.             {% endfor %}
  140.             {% for montant_tva in ventilation_tva %}
  141.                 <td class="text-center">{{ montant_tva|format_euro }}</td>
  142.             {% endfor %}
  143.             <td class="text-right" style="vertical-align: middle;">{{ (document.getMontantHt + document.getMontantTva)|format_euro }}</td>
  144.         </tr>
  145.     {% endfor %}
  146.     </tbody>
  147.     <tfoot>
  148.         <tr>
  149.             <td class="text-center" colspan="2" style="vertical-align: middle;">TOTAUX</td>
  150.             {% for total in totaux %}
  151.                 <td class="text-center">{{ total|format_euro }}</td>
  152.             {% endfor %}
  153.             <td class="text-right" style="vertical-align: middle;">{{ total_0|format_euro }}</td>
  154.             <td class="text-right" style="vertical-align: middle;">{{ total_55|format_euro }}</td>
  155.             <td class="text-right" style="vertical-align: middle;">{{ total_10|format_euro }}</td>
  156.             <td class="text-right" style="vertical-align: middle;">{{ total_20|format_euro }}</td>
  157.             <td class="text-right" style="vertical-align: middle;">{{ total_ttc|format_euro }}</td>
  158.         </tr>
  159.     </tfoot>
  160. </table>
  161. <table class="table-bordered mt-1">
  162.     <tbody>
  163.         <tr>
  164.             <td class="25p" rowspan="3">Signature Demandeur :
  165.                 {% if format_ndf in ['by-id','by-projet-salarie-mois'] %}
  166.                     {% set document = document_list[0] %}
  167.                     {% set salarie = document.getSalarie %}<br>{{ salarie.getPrenomTiers }} {{ salarie.getNomTiers }}
  168.                 {% endif %}
  169.             </td>
  170.             <td class="15p" rowspan="3">Signature Production :</td>
  171.             <td class="15p" rowspan="3">Signature Gestion :</td>
  172.             <td class="10p">TOTAL HT :</td>
  173.             <td class="10p">{{ total_ht|format_euro }}</td>
  174.             <td class="15p">Montant avance :</td>
  175.             <td class="10p">{{ total_avance|format_euro }}</td>
  176.         </tr>
  177.         <tr>
  178.             <td class="">TOTAL TVA :</td>
  179.             <td class="">{{ total_tva|format_euro }}</td>
  180.             <td class="" rowspan="2">Montant à devoir :</td>
  181.             <td class="" rowspan="2">{{ (total_ttc-total_avance)|format_euro }}</td>
  182.         </tr>
  183.         <tr>
  184.             <td class="">TOTAL TTC :</td>
  185.             <td class="">{{ total_ttc|format_euro }}</td>
  186.         </tr>
  187.     </tbody>
  188. </table>