src/Flexy/FrontBundle/Themes/Lasalle/templates/admin/shopadmin/order/orderDetail.html.twig line 1
{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}{% extends ea.templatePath('layout') %}{% trans_default_domain ea.i18n.translationDomain %}{% block configured_stylesheets %}{{ parent() }}<style>#invoice{padding: 0;}p {margin-bottom: 0.4rem;font-size:14px;margin-top: 0;}.invoice {position: relative;background-color: #FFF;min-height: 680px;padding: 15px}.invoice header {padding: 10px 0;margin-bottom: 20px;border-bottom: 1px solid #585858}.invoice .company-details {text-align: right}.invoice .company-details .name {margin-top: 0;margin-bottom: 0}.invoice .contacts {margin-bottom: 20px}.invoice .invoice-to {text-align: left}.invoice .invoice-to .to {margin-top: 0;margin-bottom: 0}.invoice .invoice-details {text-align: right}.invoice .invoice-details .invoice-id {margin-top: 0;color: #585858}.invoice main {padding-bottom: 50px}.invoice main .thanks {margin-top: -100px;font-size: 2em;margin-bottom: 50px}.invoice main .notices {margin-top: 120px;padding-left: 6px;border-left: 6px solid #585858}.invoice main .notices .notice {font-size: 1.2em}.invoice table {width: 100%;border-collapse: collapse;border-spacing: 0;margin-bottom: 20px}.invoice table td,.invoice table th {padding: 15px;background: #eee;border-bottom: 1px solid #fff}.invoice table th {white-space: nowrap;font-weight: 400;font-size: 16px}.invoice table td h3 {margin: 0;font-weight: 400;color: #585858;font-size: 1.2em}.invoice table .qty,.invoice table .total,.invoice table .unit {text-align: right;font-size: 1.2em}.invoice table .no {color: #fff;font-size: 1em;background: #585858}.invoice table .unit {background: #ddd}.invoice table .total {background: #585858;color: #fff}.invoice table tbody tr:last-child td {border: none}.invoice table tfoot td {background: 0 0;border-bottom: none;white-space: nowrap;text-align: right;padding: 10px 20px;font-size: 1.2em;border-top: 1px solid #aaa}.invoice table tfoot tr:first-child td {border-top: none}.invoice table tfoot tr:last-child td {color: #585858;font-size: 1.4em;border-top: 1px solid #585858}.invoice table tfoot tr td:first-child {border: none}.invoice footer {width: 100%;text-align: center;color: #777;border-top: 1px solid #aaa;padding: 8px 0}header { }footer { display:none; }@media only screen and (max-width: 600px) {.hide-for-small {display: none;}}@media print {.invoice {font-size: 11px!important;overflow: hidden!important}.invoice footer {position: absolute;bottom: 10px;page-break-after: always}.invoice>div:last-child {page-break-before: always}}/* Styles pour le tableau des payments */.payments-table {box-shadow: 0 2px 4px rgba(0,0,0,0.1);}.payments-table thead th {background-color: #343a40;color: white;font-weight: 600;text-transform: uppercase;font-size: 0.85em;letter-spacing: 0.5px;}.payments-table tbody tr:hover {background-color: #f8f9fa;transition: background-color 0.2s;}.payments-table tfoot {background-color: #e9ecef;font-weight: bold;}.payments-table code {background-color: #f4f4f4;padding: 2px 6px;border-radius: 3px;font-size: 0.9em;}</style>{% endblock %}{% block main %}{% set order = entity.instance %}<div class="container d-none" ><div class="toolbar hidden-print"><div class="">{% if is_granted("ROLE_SHIPPING_AGENT") == false %}<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>{% endif %}{% set urlEditStatusPayment = ea_url().setController("App\\Flexy\\FrontBundle\\Themes\\Lasalle\\Controller\\ShopAdmin\\Order\\ChangeStatusOrderPaymentCrudController").setAction("edit").setEntityId(entity.instance.id)%}<a class="btn btn-info mb-1" href="{{urlEditStatusPayment}}" >Changer l'etat de paiement</a>{% set urlEditStatusShipping = ea_url().setController("App\\Flexy\\FrontBundle\\Themes\\Lasalle\\Controller\\ShopAdmin\\Order\\ChangeStatusOrderShippingCrudController").setAction("edit").setEntityId(entity.instance.id)%}<a class="btn btn-info mb-1" href="{{urlEditStatusShipping}}" >Changer l'etat de livraison</a>{% set urlEditOrder = ea_url().setRoute("pos_cart",{"editOrderId":entity.instance.id})%}<a class="btn btn-info mb-1" href="{{urlEditOrder}}" >Editer la commande</a>{% set urlLogHistoryOrder = ea_url().setController("App\\Flexy\\FrontBundle\\Themes\\Lasalle\\Controller\\ShopAdmin\\Order\\LogHistoryOrderCrudController").setAction("index").setEntityId(null)%}<a class="btn btn-info mb-1" href="{{urlLogHistoryOrder}}&orderId={{entity.instance.id}}" >Voir Historique</a></div><hr></div><h5>Commande : <b>{{order.orderNumber}}</b></h5><ul><li>Commandé par : <b>{{order.customer}}</b></li><li>Status de la CMD :{% if order.status == "paid" %}<span class="badge badge-success" >Réglé</span>{% else %}<span class="badge badge-danger" >Non réglé</span>{% endif %}</li>{% if order.shipment %}<li>Status de la livraison : <span class="badge badge-info" >{{ order.shipment.currentStep ? order.shipment.currentStep:"En attente"}}</span></li>{% endif %}<ul></div>{# ROLE_ADMIN : afficher seulement _orderTemplate #}{% if is_granted('ROLE_ADMIN') %}{% include "@Flexy/FrontBundle/Themes/Lasalle/templates/admin/shopadmin/order/_orderTemplate.html.twig" with { order : order } %}{% endif %}{# ROLE_AGENT : afficher seulement les payments avec un design joli #}{% if is_granted('ROLE_AGENT') and not is_granted('ROLE_ADMIN') %}{% set payments = order.payments %}<div class="card mt-4"><div class="card-header bg-primary text-white"><h4 class="mb-0"><i class="fa fa-money"></i> Réglements{% if order.reference %}<span class="badge badge-light ml-2">Contrat: {{ order.reference }}</span>{% endif %}</h4></div><div class="card-body">{% if payments is not empty and payments|length > 0 %}<div class="table-responsive"><table class="table table-striped table-hover table-bordered payments-table"><thead class="thead-dark"><tr><th style="width: 10%;">#</th><th style="width: 15%;">Date</th><th style="width: 20%;">Montant</th><th style="width: 20%;">Méthode de paiement</th><th style="width: 15%;">Référence</th><th style="width: 20%;">Détails</th></tr></thead><tbody>{% set totalAmount = 0 %}{% for payment in payments %}{% set totalAmount = totalAmount + payment.amount %}<tr><td class="text-center"><strong>{{ loop.index }}</strong></td><td>{% if payment.createdAt %}{{ payment.createdAt|date('d/m/Y H:i') }}{% else %}<span class="text-muted">-</span>{% endif %}</td><td class="text-right"><strong class="text-success">{{ payment.amount|number_format(2, ',', ' ') }} MAD</strong></td><td>{% if payment.paymentMethod %}<span class="badge badge-info">{{ payment.paymentMethod.name }}</span>{% else %}<span class="text-muted">-</span>{% endif %}</td><td>{% if payment.reference %}<code>{{ payment.reference }}</code>{% else %}<span class="text-muted">-</span>{% endif %}</td><td>{% if payment.paymentMethod and payment.paymentMethod.name == "Cheque" %}<small>{% if payment.payerLastName %}<div><strong>Payeur:</strong> {{ payment.payerLastName }}</div>{% endif %}{% if payment.bankName %}<div><strong>Banque:</strong> {{ payment.bankName }}</div>{% endif %}{% if payment.bankAccountNumber %}<div><strong>Compte:</strong> {{ payment.bankAccountNumber }}</div>{% endif %}</small>{% else %}<span class="text-muted">-</span>{% endif %}</td></tr>{% endfor %}</tbody><tfoot class="bg-light"><tr><td colspan="2" class="text-right"><strong>Total:</strong></td><td class="text-right"><strong class="text-primary" style="font-size: 1.2em;">{{ totalAmount|number_format(2, ',', ' ') }} MAD</strong></td><td colspan="3"></td></tr></tfoot></table></div>{% else %}<div class="alert alert-info text-center"><i class="fa fa-info-circle"></i> Aucun règlement enregistré pour cette commande.</div>{% endif %}</div></div>{% endif %}{% endblock %}