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