- @extends('layout')
- @includes('includes/small-feature')
- <div class="container mx-auto px-8 py-8 md:py-16">
- <h1 class="text-3xl font-bold">
- {{ $item->sku }} — {{ $item->name }}
- </h1>
- @if($item->description)
- <p class="text-xl my-4">
- {{ $item->description }}
- </p>
- @endif
- <p class="text-gray-500">
- {{ $totalQuantity }} units in stock
- @if($item->reorder_level > 0)
- (reorder at {{ $item->reorder_level }})
- @endif
- </p>
-
- @if($canManage)
- <div class="flex space-x-4 my-4">
- <a href="{{ $receiveAction }}" class="bg-indigo-500 rounded-lg p-2 text-white">Receive stock</a>
- <a href="{{ $withdrawAction }}" class="bg-indigo-500 rounded-lg p-2 text-white">Withdraw stock</a>
- <a href="{{ $adjustAction }}" class="bg-indigo-500 rounded-lg p-2 text-white">Adjust stock</a>
- </div>
- @endif
-
- <h2 class="text-2xl font-bold mt-8">
- Stock by location
- </h2>
-
- @if(count($stock) === 0)
- <p class="text-gray-500 my-4">Not stored anywhere yet.</p>
- @endif
-
- <ul class="my-4 space-y-2">
- @foreach($stock as $row)
- <li class="bg-gray-50 rounded-lg p-4 flex justify-between items-center">
- <a href="{{ $row->locationRoute }}" class="font-bold underline">{{ $row->location->code }} — {{ $row->location->name }}</a>
- <span class="text-gray-500">{{ $row->quantity }} units</span>
- </li>
- @endforeach
- </ul>
-
- <h2 class="text-2xl font-bold mt-8">
- Recent activity
- </h2>
-
- @if(count($movements) === 0)
- <p class="text-gray-500 my-4">No stock movements yet.</p>
- @endif
-
- <ul class="my-4 space-y-2">
- @foreach($movements as $movement)
- <li class="bg-gray-50 rounded-lg p-2 flex justify-between items-center text-sm">
- <span>
- {{ $movement->type }} — {{ $movement->location->code }}
- @if($movement->notes)
- — {{ $movement->notes }}
- @endif
- </span>
- <span class="
- @if($movement->quantity_change < 0)
- text-red-500
- @endif
- @if($movement->quantity_change >= 0)
- text-green-600
- @endif
- ">
- @if($movement->quantity_change >= 0)
- +
- @endif
- {{ $movement->quantity_change }}
- </span>
- </li>
- @endforeach
- </ul>
- </div>
|