src/Flexy/FrontBundle/Themes/Lasalle/templates/admin/shopadmin/order/orderDetail.html.twig line 1

  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
  3. {% extends ea.templatePath('layout') %}
  4. {% trans_default_domain ea.i18n.translationDomain %}
  5. {% block configured_stylesheets %}
  6.     {{ parent() }}
  7.     <style>
  8.         #invoice{
  9.     padding: 0;
  10. }
  11. p {
  12.     margin-bottom: 0.4rem;
  13.     font-size:14px;
  14.     margin-top: 0;
  15. }
  16. .invoice {
  17.     position: relative;
  18.     background-color: #FFF;
  19.     min-height: 680px;
  20.     padding: 15px
  21. }
  22. .invoice header {
  23.     padding: 10px 0;
  24.     margin-bottom: 20px;
  25.     border-bottom: 1px solid #585858
  26. }
  27. .invoice .company-details {
  28.     text-align: right
  29. }
  30. .invoice .company-details .name {
  31.     margin-top: 0;
  32.     margin-bottom: 0
  33. }
  34. .invoice .contacts {
  35.     margin-bottom: 20px
  36. }
  37. .invoice .invoice-to {
  38.     text-align: left
  39. }
  40. .invoice .invoice-to .to {
  41.     margin-top: 0;
  42.     margin-bottom: 0
  43. }
  44. .invoice .invoice-details {
  45.     text-align: right
  46. }
  47. .invoice .invoice-details .invoice-id {
  48.     margin-top: 0;
  49.     color: #585858
  50. }
  51. .invoice main {
  52.     padding-bottom: 50px
  53. }
  54. .invoice main .thanks {
  55.     margin-top: -100px;
  56.     font-size: 2em;
  57.     margin-bottom: 50px
  58. }
  59. .invoice main .notices {
  60.     margin-top: 120px;
  61.     padding-left: 6px;
  62.     border-left: 6px solid #585858
  63. }
  64. .invoice main .notices .notice {
  65.     font-size: 1.2em
  66. }
  67. .invoice table {
  68.     width: 100%;
  69.     border-collapse: collapse;
  70.     border-spacing: 0;
  71.     margin-bottom: 20px
  72. }
  73. .invoice table td,.invoice table th {
  74.     padding: 15px;
  75.     background: #eee;
  76.     border-bottom: 1px solid #fff
  77. }
  78. .invoice table th {
  79.     white-space: nowrap;
  80.     font-weight: 400;
  81.     font-size: 16px
  82. }
  83. .invoice table td h3 {
  84.     margin: 0;
  85.     font-weight: 400;
  86.     color: #585858;
  87.     font-size: 1.2em
  88. }
  89. .invoice table .qty,.invoice table .total,.invoice table .unit {
  90.     text-align: right;
  91.     font-size: 1.2em
  92. }
  93. .invoice table .no {
  94.     color: #fff;
  95.     font-size: 1em;
  96.     background: #585858
  97. }
  98. .invoice table .unit {
  99.     background: #ddd 
  100. }
  101. .invoice table .total {
  102.     background: #585858;
  103.     color: #fff
  104. }
  105. .invoice table tbody tr:last-child td {
  106.     border: none
  107. }
  108. .invoice table tfoot td {
  109.     background: 0 0;
  110.     border-bottom: none;
  111.     white-space: nowrap;
  112.     text-align: right;
  113.     padding: 10px 20px;
  114.     font-size: 1.2em;
  115.     border-top: 1px solid #aaa
  116. }
  117. .invoice table tfoot tr:first-child td {
  118.     border-top: none
  119. }
  120. .invoice table tfoot tr:last-child td {
  121.     color: #585858;
  122.     font-size: 1.4em;
  123.     border-top: 1px solid #585858
  124. }
  125. .invoice table tfoot tr td:first-child {
  126.     border: none
  127. }
  128. .invoice footer {
  129.     width: 100%;
  130.     text-align: center;
  131.     color: #777;
  132.     border-top: 1px solid #aaa;
  133.     padding: 8px 0
  134. }
  135.     header {  }
  136.     footer { display:none; }
  137. @media only screen and (max-width: 600px) {
  138.   .hide-for-small {
  139.     display: none;
  140.   }
  141. }
  142. @media print {
  143.     .invoice {
  144.         font-size: 11px!important;
  145.         overflow: hidden!important
  146.     }
  147.     .invoice footer {
  148.         position: absolute;
  149.         bottom: 10px;
  150.         page-break-after: always
  151.     }
  152.     .invoice>div:last-child {
  153.         page-break-before: always
  154.     }
  155. }
  156. /* Styles pour le tableau des payments */
  157. .payments-table {
  158.     box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  159. }
  160. .payments-table thead th {
  161.     background-color: #343a40;
  162.     color: white;
  163.     font-weight: 600;
  164.     text-transform: uppercase;
  165.     font-size: 0.85em;
  166.     letter-spacing: 0.5px;
  167. }
  168. .payments-table tbody tr:hover {
  169.     background-color: #f8f9fa;
  170.     transition: background-color 0.2s;
  171. }
  172. .payments-table tfoot {
  173.     background-color: #e9ecef;
  174.     font-weight: bold;
  175. }
  176. .payments-table code {
  177.     background-color: #f4f4f4;
  178.     padding: 2px 6px;
  179.     border-radius: 3px;
  180.     font-size: 0.9em;
  181. }
  182.     </style>
  183. {% endblock %}
  184. {% block main %}
  185. {% set order = entity.instance %}
  186.     <div class="container d-none" >
  187.         <div class="toolbar hidden-print">
  188.         <div class="">
  189.             
  190.             {% if is_granted("ROLE_SHIPPING_AGENT") == false %}
  191.                 <a class="btn btn-info mb-1" target="_blank" href="{{path("order_pdf",{id:order.id})}}"><i class="fa fa-file-pdf-o"></i> Exporter en PDF</a>
  192.             {% endif %}
  193.     {% set urlEditStatusPayment = ea_url().setController("App\\Flexy\\FrontBundle\\Themes\\Lasalle\\Controller\\ShopAdmin\\Order\\ChangeStatusOrderPaymentCrudController")
  194.     .setAction("edit")
  195.     .setEntityId(entity.instance.id)
  196.     %}
  197.     <a class="btn btn-info mb-1" href="{{urlEditStatusPayment}}" >
  198.     Changer l'etat de paiement
  199.     </a>
  200.     {% set urlEditStatusShipping = ea_url().setController("App\\Flexy\\FrontBundle\\Themes\\Lasalle\\Controller\\ShopAdmin\\Order\\ChangeStatusOrderShippingCrudController")
  201.     .setAction("edit")
  202.     .setEntityId(entity.instance.id)
  203.     %}
  204.     <a class="btn btn-info mb-1" href="{{urlEditStatusShipping}}" >
  205.     Changer l'etat de livraison
  206.     </a>
  207.         {% set urlEditOrder = ea_url()
  208.     .setRoute("pos_cart",{"editOrderId":entity.instance.id})
  209.     %}
  210.     <a class="btn btn-info mb-1" href="{{urlEditOrder}}" >
  211.     Editer la commande
  212.     </a>
  213.       {% set urlLogHistoryOrder = ea_url().setController("App\\Flexy\\FrontBundle\\Themes\\Lasalle\\Controller\\ShopAdmin\\Order\\LogHistoryOrderCrudController")
  214.     .setAction("index").setEntityId(null)
  215.     %}
  216.     
  217.     <a class="btn btn-info mb-1" href="{{urlLogHistoryOrder}}&orderId={{entity.instance.id}}" >
  218.     Voir Historique
  219.     </a>
  220.     
  221.         </div>
  222.         <hr>
  223.     </div>
  224.     <h5>Commande : <b>{{order.orderNumber}}</b></h5>
  225.     <ul>
  226.                 <li>Commandé par : <b>{{order.customer}}</b></li>
  227.                 <li>Status de la CMD : 
  228.                     {% if order.status == "paid" %}
  229.                         <span class="badge badge-success" >Réglé</span>
  230.                     {% else %}
  231.                      <span class="badge badge-danger" >Non réglé</span>
  232.                     {% endif %}
  233.                 </li>
  234.                 {% if order.shipment %}
  235.                 <li>Status de la livraison : <span class="badge badge-info" >{{ order.shipment.currentStep ? order.shipment.currentStep:"En attente"}}</span></li>
  236.                 {% endif %}
  237.             <ul>
  238.     </div>
  239.     
  240.     {# ROLE_ADMIN : afficher seulement _orderTemplate #}
  241.     {% if is_granted('ROLE_ADMIN') %}
  242.         {% include "@Flexy/FrontBundle/Themes/Lasalle/templates/admin/shopadmin/order/_orderTemplate.html.twig" with { order : order } %}
  243.     {% endif %}
  244.     {# ROLE_AGENT : afficher seulement les payments avec un design joli #}
  245.     {% if is_granted('ROLE_AGENT') and not is_granted('ROLE_ADMIN') %}
  246.         {% set payments = order.payments %}
  247.         <div class="card mt-4">
  248.             <div class="card-header bg-primary text-white">
  249.                 <h4 class="mb-0">
  250.                     <i class="fa fa-money"></i> Réglements 
  251.                     {% if order.reference %}
  252.                         <span class="badge badge-light ml-2">Contrat: {{ order.reference }}</span>
  253.                     {% endif %}
  254.                 </h4>
  255.             </div>
  256.             <div class="card-body">
  257.                 {% if payments is not empty and payments|length > 0 %}
  258.                     <div class="table-responsive">
  259.                         <table class="table table-striped table-hover table-bordered payments-table">
  260.                             <thead class="thead-dark">
  261.                                 <tr>
  262.                                     <th style="width: 10%;">#</th>
  263.                                     <th style="width: 15%;">Date</th>
  264.                                     <th style="width: 20%;">Montant</th>
  265.                                     <th style="width: 20%;">Méthode de paiement</th>
  266.                                     <th style="width: 15%;">Référence</th>
  267.                                     <th style="width: 20%;">Détails</th>
  268.                                 </tr>
  269.                             </thead>
  270.                             <tbody>
  271.                                 {% set totalAmount = 0 %}
  272.                                 {% for payment in payments %}
  273.                                     {% set totalAmount = totalAmount + payment.amount %}
  274.                                     <tr>
  275.                                         <td class="text-center"><strong>{{ loop.index }}</strong></td>
  276.                                         <td>
  277.                                             {% if payment.createdAt %}
  278.                                                 {{ payment.createdAt|date('d/m/Y H:i') }}
  279.                                             {% else %}
  280.                                                 <span class="text-muted">-</span>
  281.                                             {% endif %}
  282.                                         </td>
  283.                                         <td class="text-right">
  284.                                             <strong class="text-success">{{ payment.amount|number_format(2, ',', ' ') }} MAD</strong>
  285.                                         </td>
  286.                                         <td>
  287.                                             {% if payment.paymentMethod %}
  288.                                                 <span class="badge badge-info">{{ payment.paymentMethod.name }}</span>
  289.                                             {% else %}
  290.                                                 <span class="text-muted">-</span>
  291.                                             {% endif %}
  292.                                         </td>
  293.                                         <td>
  294.                                             {% if payment.reference %}
  295.                                                 <code>{{ payment.reference }}</code>
  296.                                             {% else %}
  297.                                                 <span class="text-muted">-</span>
  298.                                             {% endif %}
  299.                                         </td>
  300.                                         <td>
  301.                                             {% if payment.paymentMethod and payment.paymentMethod.name == "Cheque" %}
  302.                                                 <small>
  303.                                                     {% if payment.payerLastName %}
  304.                                                         <div><strong>Payeur:</strong> {{ payment.payerLastName }}</div>
  305.                                                     {% endif %}
  306.                                                     {% if payment.bankName %}
  307.                                                         <div><strong>Banque:</strong> {{ payment.bankName }}</div>
  308.                                                     {% endif %}
  309.                                                     {% if payment.bankAccountNumber %}
  310.                                                         <div><strong>Compte:</strong> {{ payment.bankAccountNumber }}</div>
  311.                                                     {% endif %}
  312.                                                 </small>
  313.                                             {% else %}
  314.                                                 <span class="text-muted">-</span>
  315.                                             {% endif %}
  316.                                         </td>
  317.                                     </tr>
  318.                                 {% endfor %}
  319.                             </tbody>
  320.                             <tfoot class="bg-light">
  321.                                 <tr>
  322.                                     <td colspan="2" class="text-right"><strong>Total:</strong></td>
  323.                                     <td class="text-right">
  324.                                         <strong class="text-primary" style="font-size: 1.2em;">{{ totalAmount|number_format(2, ',', ' ') }} MAD</strong>
  325.                                     </td>
  326.                                     <td colspan="3"></td>
  327.                                 </tr>
  328.                             </tfoot>
  329.                         </table>
  330.                     </div>
  331.                 {% else %}
  332.                     <div class="alert alert-info text-center">
  333.                         <i class="fa fa-info-circle"></i> Aucun règlement enregistré pour cette commande.
  334.                     </div>
  335.                 {% endif %}
  336.             </div>
  337.         </div>
  338.     {% endif %}
  339.     
  340. {% endblock %}