@if (!empty($getState()))
@foreach ($getState() as $index => $detail) @endforeach
Producto Cantidad Precio Unitario IGV Total
{{ \App\Models\Product::find($detail['product_id'])?->name }} {{ $detail['quantity'] }} {{ number_format($detail['unit_value'], 2) }} {{ number_format($detail['igv'], 2) }}% {{ number_format($detail['total'], 2) }}
Subtotal: {{ number_format(collect($getState())->sum(fn($detail) => $detail['quantity'] * $detail['unit_value']), 2) }}
IGV: {{ number_format(collect($getState())->sum(fn($detail) => $detail['quantity'] * $detail['unit_value'] * ($detail['igv'] / 100)), 2) }}
Total: {{ number_format(collect($getState())->sum(fn($detail) => $detail['total']), 2) }}
@else
No hay productos seleccionados
@endif