2025-04-30 14:54:44 +02:00

61 lines
2.1 KiB
Plaintext

@model WebVentaCoche.Models.Order
@{
ViewData["Title"] = "Detalle de Pedido";
}
<div class="container mt-4">
<h2 class="mb-4">Pedido #@Model.Id</h2>
<div class="row mb-4">
<div class="col-md-6">
<p><strong>Fecha del pedido:</strong> @Model.OrderDate.ToString("g")</p>
<p><strong>Estado:</strong> @Model.Status</p>
</div>
<div class="col-md-6">
<p><strong>Dirección de envío:</strong><br />@Model.ShippingAddress</p>
<p>
<strong>Fecha de envío:</strong> @(Model.ShippedDate.HasValue ? Model.ShippedDate.Value.ToString("g") : "Pendiente")
</p>
</div>
</div>
<h4 class="mb-3">Productos del Pedido</h4>
<table class="table table-striped align-middle">
<thead class="table-dark">
<tr>
<th style="width:100px;">Imagen</th>
<th>Nombre</th>
<th>Cantidad</th>
<th>Precio unidad</th>
<th>Subtotal</th>
</tr>
</thead>
<tbody>
@foreach (var detalle in Model.OrderDetails)
{
<tr>
<td>
@if (!string.IsNullOrEmpty(detalle.Product.ImagePath))
{
<img src="@detalle.Product.ImagePath" alt="@detalle.Product.Name" class="img-fluid rounded" style="max-height:80px;" />
}
else
{
<img src="/images/default.png" alt="Sin imagen" class="img-fluid rounded" style="max-height:80px;" />
}
</td>
<td>@detalle.Product.Name</td>
<td>@detalle.Quantity</td>
<td>@detalle.UnitPrice.ToString("0.00") €</td>
<td>@detalle.Subtotal.ToString("0.00") €</td>
</tr>
}
</tbody>
</table>
<div class="text-end mt-4">
<h4>Total del pedido: @Model.TotalAmount.ToString("0.00") €</h4>
</div>
</div>