Pedido #{{ str_pad($pedido->id, 4, '0', STR_PAD_LEFT) }}

Fecha de creación: {{ date("d/m/Y", strtotime($pedido->created_at)) }}
Estatus: {{ $pedido->estatus }}
Fecha de recepción: {{ $pedido->fecha_llegada != null ? date("d/m/Y", strtotime($pedido->fecha_llegada)) : 'El pedido aún no ha sido recibido' }}

Detalles del Pedido

@php $total_productos = 0; $total_consumibles = 0; @endphp @if($pedido->pedidoProductos->where('producto_id', '!=', null)->count() > 0)

Productos

@php $total_productos = 0; @endphp @foreach($pedido->pedidoProductos->where('producto_id', '!=', null) as $pedidoProducto) @endforeach
Producto Cantidad Solicitada Cantidad Recibida Precio Unitario Subtotal
{{ $pedidoProducto->producto->nombre ?? 'N/A' }} {{ $pedidoProducto->cantidad }} {{ $pedidoProducto->cantidad_recibida ?? '-' }} ${{ number_format($pedidoProducto->precio_unitario ?? 0, 2) }} @php $subtotal = ($pedidoProducto->cantidad_recibida ?? 0) * ($pedidoProducto->precio_unitario ?? 0); $total_productos += $subtotal; @endphp ${{ number_format($subtotal, 2) }}
Total Productos: ${{ number_format($total_productos, 2) }}
@endif @if($pedido->pedidoProductos->where('consumible_id', '!=', null)->count() > 0)

Consumibles

@php $total_consumibles = 0; @endphp @foreach($pedido->pedidoProductos->where('consumible_id', '!=', null) as $pedidoProducto) @endforeach
Consumible Cantidad Solicitada Cantidad Recibida Precio Unitario Subtotal
{{ $pedidoProducto->consumible->nombre ?? 'N/A' }} {{ $pedidoProducto->cantidad }} {{ $pedidoProducto->cantidad_recibida ?? '-' }} ${{ number_format($pedidoProducto->precio_unitario ?? 0, 2) }} @php $subtotal = ($pedidoProducto->cantidad_recibida ?? 0) * ($pedidoProducto->precio_unitario ?? 0); $total_consumibles += $subtotal; @endphp ${{ number_format($subtotal, 2) }}
Total Consumibles: ${{ number_format($total_consumibles, 2) }}
@endif

Total General: ${{ number_format($total_productos + $total_consumibles, 2) }}