templates/front/command/basketPdf.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>Mon panier: {{ products|length }} produits pour le moment</title>
  6.     <style>
  7.         .clearfix:after {
  8.             content: "";
  9.             display: table;
  10.             clear: both;
  11.         }
  12.         a {
  13.             color: #5D6975;
  14.             text-decoration: underline;
  15.         }
  16.         body {
  17.             position: relative;
  18.             width: 18cm;
  19.             height: 29.7cm;
  20.             margin: 0 auto;
  21.             color: #001028;
  22.             background: #FFFFFF;
  23.             font-family: Arial, sans-serif;
  24.             font-size: 12px;
  25.             font-family: Arial;
  26.         }
  27.         header {
  28.             padding: 10px 0;
  29.             margin-bottom: 30px;
  30.         }
  31.         #logo {
  32.             text-align: center;
  33.             margin-bottom: 10px;
  34.         }
  35.         #logo img {
  36.             width: 90px;
  37.         }
  38.         h1 {
  39.             border-top: 1px solid  #5D6975;
  40.             border-bottom: 1px solid  #5D6975;
  41.             color: #5D6975;
  42.             font-size: 2.4em;
  43.             line-height: 1.4em;
  44.             font-weight: normal;
  45.             text-align: center;
  46.             margin: 0 0 20px 0;
  47.             background: url(dimension.png);
  48.         }
  49.         #project {
  50.             float: left;
  51.         }
  52.         #project span {
  53.             color: #5D6975;
  54.             text-align: right;
  55.             width: 52px;
  56.             margin-right: 10px;
  57.             display: inline-block;
  58.             font-size: 0.8em;
  59.         }
  60.         #company {
  61.             float: right;
  62.             text-align: right;
  63.         }
  64.         #project div,
  65.         #company div {
  66.             white-space: nowrap;
  67.         }
  68.         table {
  69.             width: 100%;
  70.             border-collapse: collapse;
  71.             border-spacing: 0;
  72.             margin-bottom: 20px;
  73.         }
  74.         table tr:nth-child(2n-1) td {
  75.             background: #F5F5F5;
  76.         }
  77.         table th,
  78.         table td {
  79.             text-align: center;
  80.         }
  81.         table th {
  82.             padding: 5px 20px;
  83.             color: #5D6975;
  84.             border-bottom: 1px solid #C1CED9;
  85.             white-space: nowrap;
  86.             font-weight: normal;
  87.         }
  88.         table .service,
  89.         table .desc {
  90.             text-align: left;
  91.         }
  92.         table td {
  93.             padding: 20px;
  94.             text-align: right;
  95.         }
  96.         table td.desc {
  97.             padding-top: 25px;
  98.         }
  99.         table td.service,
  100.         table td.desc {
  101.             vertical-align: top;
  102.         }
  103.         table td.unit,
  104.         table td.qty,
  105.         table td.total {
  106.             font-size: 1.2em;
  107.         }
  108.         table td.grand {
  109.             border-top: 1px solid #5D6975;;
  110.         }
  111.         #notices .notice {
  112.             color: #5D6975;
  113.             font-size: 1.2em;
  114.         }
  115.         footer {
  116.             color: #5D6975;
  117.             width: 100%;
  118.             height: 30px;
  119.             position: absolute;
  120.             bottom: 0;
  121.             border-top: 1px solid #C1CED9;
  122.             padding: 8px 0;
  123.             text-align: center;
  124.         }
  125.     </style>
  126. </head>
  127. <body>
  128. <header class="clearfix">
  129.     <div class="card-body">
  130.         <center><h3>Mon panier - {{ products|length }} produit{% if products|length > 1 %}s{% endif %}</h3></center>
  131.     </div>
  132. {#{% for onProduct in products %}
  133.     <div id="logo">
  134.         <img src="{% if onProduct.company.image %}upload/prestataires/{{ products.product.company.image }}{% endif %}" style="width:100px">
  135.     </div>
  136. {% endfor %}
  137.     <h1>Facture</h1>
  138.     <div>
  139.         <div style="float: left">
  140.         {% for oneProduct in products %}
  141.              <div><span>N° Facture :</span> {{ commandProduct.product.commandNumber }}</div> #}
  142.             {# <div><span>Client :</span> {{ oneProduct.client.firstName }} {{ oneProduct.client.lastName }}</div>
  143.             <div><span>Adresse :</span> {{ oneProduct.client.adress }} {{ product.client.zipCode }}, {{ oneProduct.client.city }}</div>
  144.             <div><span>Email :</span> <a href="mailto:{{ oneProduct.client.email }}">{{ oneProduct.client.email }}</a></div> #}
  145.             {# <div><span>Date de facturation :</span> {{ commandProduct.product.createdAt|date('d-m-Y') }}</div> 
  146.         </div>
  147.         <div style="float: right">
  148.             <div>{{ oneProduct.company.companyName }}</div>
  149.             <div>{{ oneProduct.company.adress }},<br>{{ oneProduct.company.zipCode }} {{ oneProduct.company.city }}</div>
  150.             <div>Tél : {{ oneProduct.company.contactPhone }}</div>
  151.             <div><a href="mailto:{{ oneProduct.company.email }}">{{ oneProduct.company.email }}</a></div>
  152.         </div>
  153.         {% endfor %}
  154.     </div>#}
  155. </header>
  156. <main>
  157.     <table>
  158.         <thead>
  159.         <tr>
  160.             <th class="service">Référence</th>
  161.             <th class="desc">Quantité</th>
  162.             <th class="unit">Prix unitaire</th>
  163.             <th class="total">Total</th>
  164.         </tr>
  165.         </thead>
  166.         <tbody>
  167.         {% set TotalPriceProduct = 0 %}
  168.         {% set TotalPriceProductWithQty = 0 %}
  169.         {% set TotalWithQuantity = 0 %}
  170.         {% set priceOptions = 0 %}
  171.         {% set totOpt = 0 %}
  172.         {% set totqtyOpt = 0 %}
  173.         {% for product in products %}
  174.             {% set tproduct = filter_service.getproductById(product.productId) %}
  175.             {# {% set optionObject = filter_service.getProductOption(option) %} #}
  176.             {# <pre>
  177.                 {{ dump(tproduct) }}
  178.             </pre> #}
  179.                {# {{ dump(tproduct,product['options']) }}
  180.          {% endfor %} #}
  181.               <tr>
  182.                 <td class="service">{{ tproduct.name }} 
  183.                    {# {% if product.size %}<br>Taille {{ product.size }}{% endif %} 
  184.                     {% if product.color %}<br>Couleur {{ product.color }}{% endif %} #}
  185.                 </td>
  186.                 <td class="desc">{{ product.quantity }}</td>
  187.                 <td class="unit">{{ tproduct.price|number_format(2, '.') }}€</td>
  188.                 {% set TotalWithQuantity = tproduct.price * product.quantity %}
  189.                 <td class="total">{{ TotalWithQuantity|number_format(2, '.') }}€</td>
  190.                 {% set TotalPriceProductWithQty = TotalPriceProductWithQty + TotalWithQuantity %}
  191.             </tr>
  192.                     
  193.                     {% for option in product['options'] %}
  194.                         {# {% set optionObject = filter_service.getProductOption(option) %} #}
  195.                         <tr>
  196.                             <td class="service">Option: {{ option.nom }}</td>
  197.                             
  198.                             {# {% for key,qty in product.qtyOption %} #}
  199.                                 {# {% if optionObject.id == key %} #}
  200.                                     <td class="desc">{{ option.qte }}</td>
  201.                                     {% set totqtyOpt = option.price * option.qte %}
  202.                                 {# {% endif %} #}
  203.                             {% set priceOptions = priceOptions + totqtyOpt %}
  204.                             {# {% endfor %} #}
  205.                             <td class="unit">{{ option.price|number_format(2, '.') }}€</td>
  206.                             <td class="total">{{ totqtyOpt|number_format(2, '.') }}€</td>
  207.     
  208.                         </tr>
  209.                     {% endfor %}
  210.                 {# {% endfor %} #}
  211.         
  212.         {% endfor %}
  213.         <tr>
  214.             <td colspan="3" class="grand total">TOTAL</td>
  215.             {% if pack %}
  216.                 {% set TotalPriceProductWithQty = TotalPriceProductWithQty + pack.price  %}
  217.             {% endif %}
  218.             {# {% set totalWithOptions = TotalPriceProductWithQty + priceOptions %} #}
  219.             <td class="grand total">{{ (TotalPriceProductWithQty + priceOptions)|number_format(2, '.') }}€</td>
  220.         </tr>
  221.         </tbody>
  222.     </table>
  223.     <div id="notices">
  224.         <div>Remarque :</div>
  225.         <div class="notice">TVA Non applicable, art. 293 B du CGI</div>
  226.         <div class="notice" style="margin-top:50px"><small>Votre numéro numéro de panier est confidentiel, il vous sera demandé par le prestataire pour effectué la prestation</small></div>
  227.     </div>
  228. </main>
  229. <footer>
  230.     Basket was created on a computer and is valid without the signature and seal.
  231. </footer>
  232. </body>
  233. </html>