Compra - {{ $purchase->id }}

Proveedor: {{ $purchase->provider->name }} - {{ $purchase->provider->company }}

Fecha: {{ $purchase->registration_date->format('d/m/Y') }} - Fecha entrega: {{ $purchase->arrival_date->format('d/m/Y') }}

Estado: {{ $purchase->status->name }}

A/B: {{ $purchase->has_invoice ? 'A' : 'B' }}

Moneda: {{ $purchase->currency->name }} @if ($purchase->exchange_rate > 0) Tipo de cambio: $ {{ number_format($purchase->exchange_rate, 2, ',', '.') }} @endif


Detalle

@foreach ($purchase->preOrderItems as $item) @endforeach @if ($purchase->discount_amount > 0) @endif
Item Color Cantidad Bultos Precio U. Subtotal
{{ $item->product->name }} {{ $item->color->name }} {{ $item->quantity }} {{ $item->product->measurementUnit->name }} {{ $item->packages_quantity }} $ {{ number_format($item['price'], 2, ',', '.') }} $ {{ number_format($item['price'] * $item['quantity'], 2, ',', '.') }}
Subtotal $ {{ number_format($purchase->subtotal_amount, 2, ',', '.') }}
Descuento -$ {{ number_format($purchase->discount_amount, 2, ',', '.') }}
Total $ {{ number_format($purchase->subtotal_amount - $purchase->discount_amount, 2, ',', '.') }}
{{-- @foreach ($purchase->pre_sale_items as $stock) @endforeach @if ($purchase->discount_amount > 0) @endif
Item Color Cantidad Bultos Precio U. Subtotal
{{ $stock->product->name }} {{ $stock->color->name }} {{ $stock->quantity }} {{ $stock->product->measurementUnit->name }} {{ $stock->packages_quantity }} $ {{ number_format($stock['purchase_price'], 2, ',', '.') }} $ {{ number_format($stock['purchase_price'] * $stock['quantity'], 2, ',', '.') }}
Subtotal $ {{ number_format($purchase->subtotal_amount, 2, ',', '.') }}
Descuento -$ {{ number_format($purchase->discount_amount, 2, ',', '.') }}
Total $ {{ number_format($purchase->subtotal_amount - $purchase->discount_amount, 2, ',', '.') }}
--}}

Resumen de cantidades

@foreach ($purchase->purchaseTotals['total_quantity_by_item'] as $items) @foreach ($items['colors'] as $color) @if ($loop->first) @endif @if (!$loop->last) @endif @endforeach @endforeach
Item Colores Cant. Bultos Cant. Total Total Bultos
{{ $items['product'] }}{{ $color['name'] }} {{ number_format($color['quantity'], 2, ',', '.') }} {{$color['measurement_unit']}} {{ number_format($color['packages_quantity'], 2, ',', '.') }} {{number_format($items['quantity'], 2, ',', '.')}} {{$color['measurement_unit']}} {{number_format($items['packages_quantity'], 2, ',', '.')}}
Total {{ number_format($purchase->purchaseTotals['total_quantity'], 2, ',', '.') }} {{ number_format($purchase->purchaseTotals['packages_quantity'], 2, ',', '.') }}
{{-- @foreach ($items['colors'] as $color) @endforeach
Color Cantidad Bultos
{{ $color['name'] }} {{ number_format($color['quantity'], 2, ',', '.') }} {{ number_format($color['packages_quantity'], 2, ',', '.') }}
--}} {{-- {{ $purchase->purchaseTotals['total_quantity'] }} {{ $purchase->purchaseTotals['packages_quantity'] }} --}}