templates/common/export/invoice_export.html.twig line 1

Open in your IDE?
  1. {% set totalOrderHt = 0 %}
  2. {% set totalOrderTtc = 0 %}
  3. {% set totalOrderHtTva = 0 %}
  4. {% set totalProduct = 0 %}
  5. {% set reduced = (order.cotisation.cotisationType.tag ?? '') == 'integral' and (order.cotisation.priceNationalPartCalculated ?? 0) > (order.cotisation.priceNationalPart ?? 0) %}
  6. <style>
  7.     * {
  8.         font-size: 0.8em;
  9.     }
  10.     h1, h2, h3, h4, h5, h6, .title {
  11.         color: #f8772d !important;
  12.     }
  13.     .header {
  14.         background-color: #323b74 !important;
  15.         color: #FFFFFF !important;
  16.         text-transform: uppercase !important;
  17.         border: 1px solid #323b74 !important;
  18.     }
  19.     .col-45 {
  20.         width: 45% !important;
  21.     }
  22.     .col-10 {
  23.         width: 10% !important;
  24.     }
  25.     .col-20 {
  26.             width: 20% !important;
  27.         }
  28.     table {
  29.         border-collapse: collapse;
  30.     }
  31.     table th,
  32.     table td {
  33.         font-size: 0.8em;
  34.     }
  35.     table.no-border,
  36.     table.no-border th,
  37.     table th,
  38.     table.no-border td
  39.     table td {
  40.         border: 0 !important;
  41.     }
  42.     table td {
  43.         vertical-align: top;
  44.     }
  45.     table.no-border th.col-border,
  46.     table th.col-border {
  47.         border-left: 1px solid rgba(50, 59, 116, 0.2) !important;
  48.         border-right: 1px solid rgba(50, 59, 116, 0.2) !important;
  49.         border-bottom: 1px solid rgba(50, 59, 116, 0.2) !important;
  50.         border-top: 1px solid rgba(50, 59, 116, 0.2) !important;
  51.         border-top-left-radius: 5px;
  52.         border-top-right-radius: 5px;
  53.         min-height: 50px;
  54.     }
  55.     table td.col-border,
  56.     table.no-border td.col-border {
  57.         border-left: 1px solid rgba(50, 59, 116, 0.2) !important;
  58.         border-right: 1px solid rgba(50, 59, 116, 0.2) !important;
  59.         border-bottom: 1px solid rgba(50, 59, 116, 0.2) !important;
  60.     }
  61.     table td.col-border-left,
  62.     table.no-border td.col-border-left,
  63.     table th.col-border-left,
  64.     table.no-border th.col-border-left {
  65.         border-left: 1px solid rgba(50, 59, 116, 0.2) !important;
  66.     }
  67.     table td.col-border-right,
  68.     table.no-border td.col-border-right,
  69.     table th.col-border-right,
  70.     table.no-border th.col-border-right {
  71.         border-right: 1px solid rgba(50, 59, 116, 0.2) !important;
  72.     }
  73.     table td.col-border-bottom,
  74.     table.no-border td.col-border-bottom,
  75.     table th.col-border-bottom,
  76.     table.no-border th.col-border-bottom {
  77.         border-bottom: 1px solid rgba(50, 59, 116, 0.2) !important;
  78.     }
  79.     table td.col-border-top,
  80.     table.no-border td.col-border-top,
  81.     table th.col-border-top,
  82.     table.no-border th.col-border-top {
  83.         border-top: 1px solid rgba(50, 59, 116, 0.2) !important;
  84.     }
  85.     .cell-header {
  86.         background-color: #323b74 !important;
  87.         color: #ffffff;
  88.         border: 1px solid #323b74 !important;
  89.     }
  90.     .align-left {
  91.         text-align: left;
  92.     }
  93.     .label {
  94.         font-weight: bold !important;
  95.         float: right !important;
  96.     }
  97.     .value {
  98.         float: left !important;
  99.     }
  100.     .cell-padding {
  101.         padding: 5px;
  102.     }
  103.     .mb-2 {
  104.         margin-bottom: 1em;
  105.     }
  106.     .mb-3 {
  107.         margin-bottom: 1.5em;
  108.     }
  109.     .mb-4 {
  110.         margin-bottom: 2em;
  111.     }
  112.     .mb-5 {
  113.         margin-bottom: 3em;
  114.     }
  115.     .col-pt td {
  116.         padding-top: 5px;
  117.     }
  118.     .text-small {
  119.         font-size: 0.7em;
  120.     }
  121. </style>
  122. <page>
  123.     <div class="mb-2" style="text-align: center;">
  124.         <img src="{{ asset('build/backend/images/ffcb_logo.jpg', 'backend') }}" style="width: 150px; height: auto;" alt="Logo FFCB">
  125.     </div>
  126.     <h3 class="mb-3" style="padding-top: 25px; text-align: center; width: 100%">Facture {{ order.generateInvoiceNumber }}</h3>
  127.     <table class="no-border mb-3" style="width: 100%">
  128.         <thead>
  129.             <tr>
  130.                 <th class="header col-border align-left cell-padding col-45">FFCB</th>
  131.                 <th class="col-10"></th>
  132.                 <th class="header col-border align-left cell-padding col-45">Livraison</th>
  133.             </tr>
  134.         </thead>
  135.         <tbody>
  136.             <tr>
  137.                 <td class="col-border cell-padding">
  138.                     <div class="mb-2">
  139.                         {{ address|nl2br }}
  140.                     </div>
  141.                     <br>
  142.                     <div class="mb-2">
  143.                         <span class="label">Tél: </span>
  144.                         <span class="value">{{ phone }}</span>
  145.                     </div>
  146.                     <br>
  147.                     <div class="mb-2">
  148.                         <span class="label">Email: </span>
  149.                         <span class="value">{{ email }}</span>
  150.                     </div>
  151.                     <br>
  152.                 </td>
  153.                 <td></td>
  154.                 <td class="col-border cell-padding">
  155.                     {{ order.firm.raisonSocial }}<br><br>
  156.                     {{ displayAddress(order.deliveryAddress) }}
  157.                 </td>
  158.             </tr>
  159.         </tbody>
  160.     </table>
  161.     <table class="no-border mb-3" style="width: 100%">
  162.         <tbody>
  163.             <tr>
  164.                 <td>Banque: <span style="color: darkred">{{ bank }}</span></td>
  165.             </tr>
  166.             <tr>
  167.                 <td>IBAN: <span style="color: darkred">{{ iban }}</span></td>
  168.             </tr>
  169.             <tr>
  170.                 <td>BIC: <span style="color: darkred">{{ bic }}</span></td>
  171.             </tr>
  172.         </tbody>
  173.     </table>
  174.     <table class="no-border mb-5" style="width: 100%;">
  175.         <thead>
  176.             <tr>
  177.                 <th class="header col-border cell-padding align-left col-45">{{ order.cotisation ? ( 'Type de cotisation: ' ~ (order.cotisation.cotisationType.name ?? '') ~ ' - ' ~ (order.cotisation.year ?? '')) : 'Produits' }}</th>
  178.             </tr>
  179.         </thead>
  180.         <tbody>
  181.             <tr>
  182.                 <td class="col-border cell-padding">
  183.                     <table style="width: 100%;">
  184.                         <thead>
  185.                             <tr>
  186.                                 <th class="align-left">Code</th>
  187.                                 <th class="align-left">{{ order.cotisation ? 'Désignation' : 'Produit' }}</th>
  188.                                 <th class="align-left">Quantité</th>
  189.                                 <th class="align-left">Prix unit. HT</th>
  190.                                 <th class="align-left">Prix total. HT</th>
  191.                                 <th class="align-left">Taux Tva</th>
  192.                                 <th class="align-left">Prix total TTC</th>
  193.                             </tr>
  194.                         </thead>
  195.                         <tbody class="col-pt">
  196.                             {% for line in order.orderLines %}
  197.                                 <tr>
  198.                                     <td>{{ line.product.code|upper }}</td>
  199.                                     <td>{{ line.product.name }}{{ reduced and line.product.code|upper == 'PARTN' ? '*' }}</td>
  200.                                     <td>{{ line.quantity }}</td>
  201.                                     <td>{{ line.unitPrice|number_format(2, ',', ' ') }} €</td>
  202.                                     <td>{{ line.totalPrice|number_format(2, ',', ' ') }} €</td>
  203.                                     <td>{{ line.vat }}%</td>
  204.                                     <td>{{ (line.totalPrice * (1 + line.vat / 100))|number_format(2, ',', ' ') }} €</td>
  205.                                 </tr>
  206.                                 {% if line.vat > 0 %}
  207.                                     {% set totalOrderHtTva = totalOrderHtTva + (totalOrderHt * line.quantity) %}
  208.                                 {% endif %}
  209.                                 {% set totalOrderHt = totalOrderHt + (line.unitPrice * line.quantity) %}
  210.                                 {% set totalOrderTtc = totalOrderTtc + (line.totalPrice * (1 + line.vat / 100)) %}
  211.                                 {% set totalProduct = totalProduct + line.quantity %}
  212.                             {% endfor %}
  213.                         </tbody>
  214.                     </table>
  215.                 </td>
  216.             </tr>
  217.         </tbody>
  218.     </table>
  219.     <table class="no-border" style="width: 100%">
  220.         <thead>
  221.             <tr>
  222.                 <th class="header col-border cell-padding align-left col-45">Récapitulatif des échéances</th>
  223.             </tr>
  224.         </thead>
  225.         <tbody>
  226.             <tr>
  227.                 <td class="col-border cell-padding">
  228.                     <table style="width: 100%;">
  229.                         <thead>
  230.                             <tr>
  231.                                 <th class="align-left">Date</th>
  232.                                 <th class="align-left">Date de paiement</th>
  233.                                 <th class="align-left">Date échéance</th>
  234.                                 <th class="align-left">Mode de règlement</th>
  235.                                 <th class="align-left">Réf de la Commande</th>
  236.                             </tr>
  237.                         </thead>
  238.                         <tbody class="col-pt">
  239.                             <tr>
  240.                                 <td class="col-20">{{ (order.invoiceDate ?? order.orderDate)|date('d/m/Y') }}</td>
  241.                                 <td class="col-20">{{ order.cotisation and order.cotisation.datePaiement ? order.cotisation.datePaiement|date('d/m/Y') }}</td>
  242.                                 <td class="col-20">{{ order.invoiceDate|date('d/m/Y') }}</td>
  243.                                 <td class="col-20">{{ order.paymentType.name|upper }}</td>
  244.                                 <td class="col-20">{{ order.number }}</td>
  245.                             </tr>
  246.                         </tbody>
  247.                     </table>
  248.                 </td>
  249.             </tr>
  250.         </tbody>
  251.     </table>
  252.     <div class="mb-5 text-small">
  253.         <small><i>{{ notice }}</i></small>
  254.     </div>
  255.     {% if reduced  %}
  256.     <div class="mb-5 text-small">
  257.         <small><i>* Le montant de la part nationale calculé de {{ order.cotisation.priceNationalPartCalculated|number_format(2, ',', ' ') }} € HT a été plafonné à {{ order.cotisation.priceNationalPart|number_format(2, ',', ' ') }} € HT</i></small>
  258.     </div>
  259.     {% endif %}
  260.     <table class="no-border" style="width: 100%">
  261.         <tbody>
  262.             <tr>
  263.                 <td class="col-45"></td>
  264.                 <td class="col-10"></td>
  265.                 <td class="col-border col-border-top" style="padding: 0;">
  266.                     <table class="no-border" style="width: 100%;">
  267.                         <tbody class="col-pt">
  268.                             <tr>
  269.                                 <th class="cell-header">Total HT</th>
  270.                                 <td>{{ (order.cotisation ? order.cotisation.priceHt : totalOrderHt)|number_format(2, ',', ' ') }} €</td>
  271.                             </tr>
  272.                             <tr>
  273.                                 <th class="cell-header">Total TVA</th>
  274.                                 <td>{{ (order.cotisation ? order.cotisation.priceVat : (totalOrderTtc - totalOrderHt))|number_format(2, ',', ' ') }} €</td>
  275.                             </tr>
  276.                             <tr>
  277.                                 <th class="cell-header">Total TTC</th>
  278.                                 <td>{{ (order.cotisation ? order.cotisation.priceTtc : totalOrderTtc)|number_format(2, ',', ' ') }} €</td>
  279.                             </tr>
  280.                             <tr>
  281.                                 <th class="cell-header">Net à payer</th>
  282.                                 <td>{{ (order.cotisation ? order.cotisation.priceTtc : totalOrderTtc)|number_format(2, ',', ' ') }} €</td>
  283.                             </tr>
  284.                             <tr>
  285.                                 <th class="cell-header">Solde dû</th>
  286.                                 <td>{{ order.status == constant('App\\Entity\\Order::STATUS_PAID') ? 0 : (order.cotisation ? order.cotisation.priceTtc : totalOrderTtc)|number_format(2, ',', ' ') }} €</td>
  287.                             </tr>
  288.                         </tbody>
  289.                     </table>
  290.                 </td>
  291.             </tr>
  292.         </tbody>
  293.     </table>
  294. </page>