|
{{ $loop->iteration + ($stocks->currentPage() - 1) * $stocks->perPage() }}
|
{{ trim($stock->product->product_code) }} - {{ $stock->product->product_name }}
|
{{ $stock->warehouse->warehouse_name }} |
{{ rtrim(rtrim(number_format($stock->quantity_on_hand, 2), '0'), '.') }}
|
{{ rtrim(rtrim(number_format($stock->quantity_available, 2), '0'), '.') }}
|
@php
$batchesJson = $batches->map(fn($b) => [
'batch_code' => $b->stockBatch?->batch_code ?? '—',
'receipt_date' => $b->stockBatch?->receipt_date ? \Carbon\Carbon::parse($b->stockBatch->receipt_date)->format('d-M-Y') : '—',
'quantity' => rtrim(rtrim(number_format($b->quantity_on_hand, 2), '0'), '.'),
'unit_cost' => $b->quantity_on_hand > 0 ? rtrim(rtrim(number_format($b->total_value / $b->quantity_on_hand, 6), '0'), '.') : rtrim(rtrim(number_format($b->unit_cost, 6), '0'), '.'),
'selling_price' => $b->stockBatch?->selling_price ? number_format($b->stockBatch->selling_price, 2) : null,
'total_value' => number_format($b->total_value, 2),
'is_promotional' => $b->is_promotional,
'promotional_price' => $b->promotional_price ? number_format($b->promotional_price, 2) : null,
'status' => $b->status,
'priority_order' => $b->priority_order,
])->values()->toArray();
$productLabel = trim($stock->product->product_code) . ' - ' . $stock->product->product_name;
@endphp
{{-- Total Value — clickable if batches loaded --}}
@if($batchCount > 0)
{{ number_format($stock->total_value, 2) }}
@else
₨ {{ number_format($stock->total_value, 2) }}
@endif
|
{{ $stock->total_batches }}
@if($stock->promotional_batches > 0)
P:{{ $stock->promotional_batches }}
@endif
@if($stock->priority_batches > 0)
!:{{ $stock->priority_batches }}
@endif
|
View Batches
|
@endforeach
@endif