@extends('layouts.app')
@section('title','Product Stock')
@section('content')<div class="page-head"><div><h1>{{ $product->name_en }}</h1><p>{{ $product->product_code }} · Stock by warehouse</p></div><a class="btn btn-light border" href="{{ route('stock-ledger.index',['product_id'=>$product->id]) }}">Full ledger</a></div><div class="card-erp"><div class="table-responsive"><table class="table table-dense"><thead><tr><th>Warehouse</th><th>Type</th><th class="text-end">Quantity</th><th class="text-end">Average cost</th><th class="text-end">Value</th></tr></thead><tbody>@foreach($stocks as $s)<tr><td>{{ $s->warehouse?->code }} · {{ $s->warehouse?->name_en }}</td><td>{{ ucfirst($s->warehouse?->type) }}</td><td class="text-end fw-bold">{{ number_format((float)$s->qty,4) }}</td><td class="text-end">{{ number_format((float)$s->avg_cost,4) }}</td><td class="text-end">{{ number_format((float)$s->qty*(float)$s->avg_cost,2) }}</td></tr>@endforeach</tbody></table></div></div>@endsection
