src/IlaveU/FrontBundle/Themes/IlaveU/templates/admin/shopadmin/order/_orderTemplate.html.twig line 1

  1. {% if order is defined %}
  2.     {% set currency = settings.get.currency|trans({},"admin") %}
  3.     {% set notAllProductCanBeTreatedInShippingMethod = false %}
  4.     {% set oldReductionPromo = 0 %}
  5.     
  6.     {% if  getMetaDataValue(order.metaData,"applied_cashback_amt") %}
  7.         {% set oldReductionPromo = getMetaDataValue(order.metaData,"applied_cashback_amt") %}
  8.     {% endif %}
  9.     
  10.     <div id="invoice">
  11.         <div class="invoice-mask-logo"></div>
  12.         <div class="invoice">
  13.             <div>
  14.                 <header>
  15.                     <div class="row">
  16.                         <div class="col"></div>
  17.                     </div>
  18.                 </header>
  19.                 <main>
  20.                     <div class="row contacts">
  21.                         <div
  22.                             class="col-4 invoice-to">
  23.                             <!-- Info Company  -->
  24.                             <div class="date">
  25.                                 <a target="_blank" href="#">
  26.                                     <img width="120" src="{{settings.get().logoBase64}}">
  27.                                 </a>
  28.                                 <p style="max-width:210px;font-size:0.7rem;" class="mt-3">
  29.                                     <small>{{settings.get.address}}</small>
  30.                                 </p>
  31.                             </div>
  32.                         </div>
  33.                         <div class="col-8 invoice-details">
  34.                             <div class="text-gray-light"></div>
  35.                             {% if order.customer %}
  36.                                 <h2 class="to">{{order.customer.firstName}}
  37.                                     {{order.customer.lastName}}</h2>
  38.                             {% else %}
  39.                                 <h2 class="to">{{order.firstName}}
  40.                                     {{order.lastName}}</h2>
  41.                             {% endif %}
  42.                             <div class="address d-none">
  43.                                 <b>Adresse</b>
  44.                                 {{order.customer ? order.customer.address : order.address}}
  45.                             </div>
  46.                             <div class="address d-none">
  47.                                 <b>Code postal</b>
  48.                                 {{order.postCode}}
  49.                             </div>
  50.                             <div class="address d-none">
  51.                                 <b>Ville</b>
  52.                                 {{order.city}}
  53.                             </div>
  54.                             <div class="address">
  55.                                 <b>Tel : </b>
  56.                                 {% if order.customer %}
  57.                                     <a href="tel:{{order.customer.phone}} ">{{order.customer.phone}}</a>
  58.                                 {% else %}
  59.                                     <a href="tel:{{order.tel}} ">{{order.tel}}></a>
  60.                                 {% endif %}
  61.                             </div>
  62.                             {% if order.customer %}
  63.                                 {% if order.customer.description %}
  64.                                     <div class="badge badge-info">
  65.                                         <b>Note</b>
  66.                                         {{order.customer.description}}
  67.                                     </div>
  68.                                 {% endif %}
  69.                             {% endif %}
  70.                             <div class="email">
  71.                                 <b>Email : </b> 
  72.                                 {% if order.customer %}
  73.                                     
  74.                                     <a href="mailto:{{order.customer.email}} ">{{order.customer.email}}
  75.                                 {% else %}
  76.                                     <a href="mailto:{{order.email}} ">{{order.email}}
  77.                                 {% endif %}
  78.                                 </a>
  79.                             </div>
  80.                         </div>
  81.                         <div class="col-12 text-right mt-4" style="text-align:right;margin-top:30px;">
  82.                         
  83.                             <div class="date">
  84.                             
  85.                             Nombre total de produits 
  86.                             <b>
  87.                             
  88.                             
  89.                             {% set totalProducts = 0 %}
  90.                             {% for singleOrderItem in order.orderItems %}
  91.                                 {% if singleOrderItem.decimalQuantity != null and singleOrderItem.quantity >= 0  %}
  92.                                     
  93.                                     {% set totalProducts = totalProducts + 1 %}
  94.                                 {% else %}
  95.                                     {% if singleOrderItem.product %}
  96.                                         {% set totalProducts = totalProducts + (singleOrderItem.product.defaultQuantity * singleOrderItem.quantity) %}
  97.                                         {% else %}
  98.                                         {% set totalProducts = totalProducts + singleOrderItem.quantity %}
  99.                                     {% endif  %}
  100.                                 {% endif  %}
  101.                             {% endfor  %}
  102.                             
  103.                                     {{totalProducts}}
  104.                             
  105.                             </b>
  106.                             | Num de
  107.                                 {{order.orderType|trans({},"admin")}}
  108.                                 <b>{{order.orderNumber}}</b>
  109.                                 | Date de commande
  110.                                 <b>{{order.createdAt|date('d/m/Y')}}</b>
  111.                             </div>
  112.                         </div>
  113.                     </div>
  114.                     <table border="0" cellspacing="0" cellpadding="0">
  115.                         <thead>
  116.                             <tr>
  117.                                 <th>Produit</th>
  118.                                 <th class="text-left hide-for-small">Service</th>
  119.                                 <th class="text-right">Prix</th>
  120.                                 {# <th class="text-right hide-for-small">Reduction</th> #}
  121.                                 <th class="text-right">TOTAL</th>
  122.                             </tr>
  123.                         </thead>
  124.                         <tbody>
  125.                             
  126.                             {% set totalCommission = 0 %}
  127.                             {% set totalOrder = 0 %}
  128.                             {% for singleOrderItem in order.orderItems %}
  129.                                 {% set finalPrice = singleOrderItem.finalPrice %}
  130.                                 
  131.                                         
  132.                                 <tr>
  133.                                     <td class="no">
  134.                                         {{singleOrderItem.description}}
  135.                                         {% if singleOrderItem.product %}
  136.                                             {% if singleOrderItem.product.includedShippingMethods|length > 0 %}
  137.                                                 {% set notAllProductCanBeTreatedInShippingMethod = true %}
  138.                                                 {% if order.shippingMethod not in singleOrderItem.product.includedShippingMethods %}
  139.                                                     <br>
  140.                                                     <small>Ce produit ne peut pas être traité en
  141.                                                         <b>{{order.shippingMethod.name}}</b></small>
  142.                                                 {% endif %}
  143.                                             {% endif %}
  144.                                         {% endif %}
  145.                                         <!-- Button trigger modal -->
  146.                                     </td>
  147.                                     <td class="text-left hide-for-small">
  148.                                         <p style="font-size:9px;">
  149.                                             {% if singleOrderItem.product %}
  150.                                                 {% for categorie in singleOrderItem.product.categoriesProduct   %}
  151.                                                     {{categorie}},
  152.                                                 {% endfor %}
  153.                                             {% elseif singleOrderItem.packEngagement  %}
  154.                                                 {{ singleOrderItem.packEngagement.pack.title }}
  155.                                             {% endif %}
  156.                                         </p>
  157.                                     </td>
  158.                                     <td class="unit" style="white-space:nowrap;">
  159.                                             {{finalPrice }}
  160.                                             {{currency}}
  161.                                         
  162.                                         X
  163.                                     {{
  164.                                         singleOrderItem.decimalQuantity ? singleOrderItem.decimalQuantity : singleOrderItem.quantity
  165.                                         }}
  166.                                     </td>
  167.                                     {# <td class="qty hide-for-small" style="white-space:nowrap;">
  168.                                         {% if singleOrderItem.reduction > 0 %}
  169.                                             {{singleOrderItem.reduction }}
  170.                                             {{currency}}
  171.                                         {%  elseif singleOrderItem.product %}
  172.                                             {% if singleOrderItem.product.reduction > 0 %}
  173.                                                 {{singleOrderItem.product.reduction}}
  174.                                                 {{currency}}
  175.                                             {% else %}
  176.                                                 0
  177.                                                 {{currency}}
  178.                                             {% endif %}
  179.                                         {% else %}
  180.                                             0
  181.                                             {{currency}}
  182.                                         {% endif %}
  183.                                     </td> #}
  184.                                     <td class="total" style="white-space:nowrap;">
  185.                                         {% set totalOrder = totalOrder + (singleOrderItem.totalAmount) %}
  186.                                         {{singleOrderItem.totalAmount|number_format(2, ',', ' ') }}
  187.                                         {{currency}}
  188.                                     </td>
  189.                                 </tr>
  190.                             {% endfor %}
  191.                         </tbody>
  192.                         <tfoot>
  193.                             {% set reductionCoupon = 0 %}
  194.                             {% if  order.coupon %}
  195.                                 {% if order.coupon.typeReduction == "percent" %}
  196.                                     {% set reductionCoupon = (order.totalAmount / 100) * order.coupon.valueReduction %}
  197.                                 {% else %}
  198.                                     {% set reductionCoupon =  order.coupon.valueReduction %}
  199.                                 {% endif %}
  200.                             {% endif %}
  201.                             {% set totalToPay =  (totalOrder + order.shippingFees + order.shippingTips)  - reductionCoupon -  order.reductionOnTotal + (order.getAmountPayedByCredit) %}
  202.                             <tr>
  203.                                 <td colspan="1" class="hide-for-small"></td>
  204.                                 <td colspan="2">Total produits</td>
  205.                                 <td>{{order.totalAmount|number_format(2, ',', ' ')}}
  206.                                     {{currency}}</td>
  207.                             </tr>
  208.                             {% if order.shippingFees > 0 %}
  209.                                 <tr>
  210.                                     <td colspan="1" class="hide-for-small"></td>
  211.                                     <td colspan="2">Frais de livraison</td>
  212.                                     <td>{{ order.shippingFees|number_format(2, ',', ' ') }}
  213.                                         {{currency}}</td>
  214.                                 </tr>
  215.                             {% endif %}
  216.                             
  217.                             
  218.                             
  219.                             {#
  220.                             
  221.                             
  222.                             
  223.                             
  224.                             
  225.                             {% if order.getTotalReduction > 0 %}
  226.                                 <tr>
  227.                                     <td colspan="1" class="hide-for-small"></td>
  228.                                     <td colspan="2">Total Reduction sur produits</td>
  229.                                     <td>{{order.getTotalReduction|number_format(2, ',', ' ')}}
  230.                                         {{currency}}</td>
  231.                                 </tr>
  232.                             {% endif %}
  233.                             #}
  234.                             {% if order.reduction and order.reduction > 0 %}
  235.                                 <tr>
  236.                                     <td colspan="1" class="hide-for-small"></td>
  237.                                     <td colspan="2">
  238.                                     
  239.                                     
  240.                                     Remise sur la commande ({{order.reductionInPercent}}%)
  241.                                     
  242.                                     </td>
  243.                                     <td>{{order.reduction|number_format(2, ',', ' ')}}
  244.                                         {{currency}}</td>
  245.                                 </tr>
  246.                             {% endif %}
  247.                             {% if order.walletPaymentAmount > 0 %}
  248.                                 <tr>
  249.                                 <td colspan="1" class="hide-for-small"></td>
  250.                                 <td colspan="2">Crédit utilisé</td>
  251.                                 <td>{{order.walletPaymentAmount|abs|number_format(2, ',', ' ')}}
  252.                                     {{currency}}</td>
  253.                                 </tr>
  254.                             {% endif %}
  255.                             
  256.                             {% if order.getAmountEarnedAsCredit and order.getAmountEarnedAsCredit != 0 %}
  257.                                 <tr>
  258.                                     <td colspan="1" class="hide-for-small"></td>
  259.                                     <td colspan="2">Montant ajouté au wallet client</td>
  260.                                     <td>{{order.getAmountEarnedAsCredit|abs|number_format(2, ',', ' ')}}
  261.                                         {{currency}}</td>
  262.                                 </tr>
  263.                             {% endif %}
  264.                             {% if reductionCoupon > 0  %}
  265.                                 <tr>
  266.                                     <td colspan="1" class="hide-for-small"></td>
  267.                                     <td colspan="2">Code Coupon utilisé ({{order.coupon.code }})</td>
  268.                                     <td>{{reductionCoupon|abs|number_format(2, ',', ' ')}}
  269.                                         {{currency}}</td>
  270.                                 </tr>
  271.                             {% endif %}
  272.                             {% if order.shippingTips > 0 %}
  273.                                 <tr>
  274.                                     <td colspan="1" class="hide-for-small"></td>
  275.                                     <td colspan="2">Pourboire pour le livreur</td>
  276.                                     <td>{{ order.shippingTips|number_format(2, ',', ' ') }}
  277.                                         {{currency}}</td>
  278.                                 </tr>
  279.                             {% endif %}
  280.                             
  281.                             
  282.                             
  283.                             {% if oldReductionPromo > 0 %}
  284.                                 <tr>
  285.                                     <td colspan="1" class="hide-for-small"></td>
  286.                                     <td colspan="2">Reduction Promo</td>
  287.                                     <td>{{oldReductionPromo|number_format(2, ',', ' ')}}
  288.                                         {{currency}}</td>
  289.                                 </tr>
  290.                             {% endif %}
  291.                             {% if order.payedAmount > 0 %}
  292.                                 <tr>
  293.                                 <td colspan="1" class="hide-for-small"></td>
  294.                                 <td colspan="2">Montant payé</td>
  295.                                 {% set payedAmount = order.payedAmount  %}
  296.                                     {% if order.getAmountEarnedAsCredit > 0 %}
  297.                                         {% set payedAmount = order.payedAmount + order.getAmountEarnedAsCredit %}
  298.                                     {% endif %}
  299.                                 <td colspan="2">{{ payedAmount|number_format(2, ',', ' ') }}
  300.                                     {{currency}}</td>
  301.                                 {#
  302.                                                             <td>{{order.totalAmount + order.ldryOrder.deliveryPrice}} {{currency}}</td>
  303.                                                             #}
  304.                             </tr>
  305.                             {% endif %}
  306.                             {% if order.fullRestAmount > 0 %}
  307.                                 <tr>
  308.                                     <td colspan="1" class="hide-for-small"></td>
  309.                                     <td colspan="2">Reste à payer</td>
  310.                                     <td>{{ order.fullRestAmount|number_format(2, ',', ' ') }}
  311.                                         {{currency}}</td>
  312.                                 </tr>
  313.                             {% endif %}
  314.                             
  315.                             
  316.                             
  317.                             
  318.                             
  319.                             
  320.                             
  321.                             
  322.                             <tr>
  323.                                 <td colspan="1" class="hide-for-small"></td>
  324.                                 <td colspan="2"><b>Montant Total</b></td>
  325.                                 <td colspan="2">
  326.                                     
  327.                                     
  328.                                     <b>{{ (order.fullTotalAmount - oldReductionPromo)|number_format(2, ',', ' ') }}
  329.                                     {{currency}}</b></td>
  330.                                 {#
  331.                                                             <td>{{order.totalAmount + order.ldryOrder.deliveryPrice}} {{currency}}</td>
  332.                                                             #}
  333.                             </tr>
  334.                         </tfoot>
  335.                     </table>
  336.                     <div class="thanks"></div>
  337.                     <div class="notices ">
  338.                         <div>INFOS:</div>
  339.                         <div class="notice">
  340.                             {% if notAllProductCanBeTreatedInShippingMethod %}
  341.                                 
  342.                                 
  343.                                 <p>
  344.                                     Important:
  345.                                     <span class="badge badge-info">Un ou plusieurs produits sélectionnés ne peuvent être traités en
  346.                                     <b>{{order.shippingMethod.name}}</b>
  347.                                 </span>
  348.                                 </p>
  349.                             {% endif %}
  350.                             {% if order.comment %}
  351.                                 <p>
  352.                                     Note sur la commande:
  353.                                     <span class="badge badge-info">{{order.comment}}</span>
  354.                                 </p>
  355.                             {% endif %}
  356.                             {% if order.shippingMethod %}
  357.                                 {% if order.shippingMethod.isIsSeparatelyCalculated %}
  358.                                     <p>
  359.                                         Mode livraison :
  360.                                         <span class="badge badge-success">{{order.shippingMethod}}</span>
  361.                                     </p>
  362.                                 {% endif %}
  363.                             {% endif %}
  364.                             {% if order.paymentMethod %}
  365.                                 <p>
  366.                                     Mode Paiement :<span class="badge badge-success">
  367.                                         {{order.paymentMethod }}</span>
  368.                                 </p>
  369.                             {% endif %}
  370.                             {% if order.agent %}
  371.                                 <p>
  372.                                     Livreur :
  373.                                     <span class="badge badge-warning">{{order.agent.firstName}}
  374.                                         {{order.agent.lastName}}</span>
  375.                                 </p>
  376.                             {% endif %}
  377.                             {% if order.shippingMethod %}
  378.                                 {% set shippingDurationInMinutes = order.shippingMethod.shippingDuration * 60 %}
  379.                                 {% if order.shippingMethod.isIsSeparatelyCalculated %}
  380.                                     <p>
  381.                                         Date collecte :
  382.                                         <span class="badge badge-warning">{{order.startProcessingAt|date("Y-m-d H:i")}}
  383.                                             -
  384.                                             {{order.startProcessingAt|date_modify("+ "~shippingDurationInMinutes~" minutes")|date("H:i")}}</span>
  385.                                     </p>
  386.                                     <p>
  387.                                         Date livraison :
  388.                                         <span class="badge badge-warning">{{order.startDeliveryAt|date("Y-m-d H:i")}}
  389.                                             -
  390.                                             {{order.startDeliveryAt|date_modify("+ "~shippingDurationInMinutes~" minutes")|date("H:i")}}</span>
  391.                                     </p>
  392.                                 {% endif %}
  393.                             {% endif %}
  394.                             {% if order.description %}
  395.                                 <b>Informations utiles</b>
  396.                                 <div class="badge badge-info">{{order.description}}
  397.                                 </div>
  398.                             {% endif %}
  399.                         </div>
  400.                     </div>
  401.                 </main>
  402.             </div>
  403.             <!--DO NOT DELETE THIS div. IT is responsible for showing footer always at the bottom-->
  404.             <div></div>
  405.         </div>
  406.     </div>
  407. {% endif %}