@extends('layouts.app') @section('content')
Stock Management

@if(session('success')) @endif
count() > 0) id="bookings-table" @endif class="table table-bordered align-middle text-center"> @forelse($stocks as $stock) @empty @endforelse
ID Product Status Quantity Approval Next Arrival Restock Date Actions
{{ $stock->id }} {{ $stock->product->name }} {{--
Model: {{ $stock->product->model ?? 'N/A' }} --}}
@php $statusColors = [ 'in_stock' => 'success', 'out_of_stock' => 'danger', 'arriving' => 'warning' ]; @endphp {{ str_replace('_', ' ', ucfirst($stock->availability_status)) }} {{ $stock->quantity }} @if($stock->quantity == 0)
Out of stock @endif
@if($stock->requires_approval) @if($stock->is_approved) Approved @else Pending @endif @else No Approval Needed @endif @if($stock->next_arrival_date) {{ date('M d, Y', strtotime($stock->next_arrival_date)) }} @else N/A @endif @if($stock->expected_restock_date) {{ date('M d, Y', strtotime($stock->expected_restock_date)) }} @else N/A @endif
{{-- View Button --}} @can('view stocks') @endcan {{-- Edit Button --}} @can('update stock') @endcan {{-- Delete Button --}} @can('delete stock')
@csrf @method('DELETE')
@endcan
No stock records found.
{{ $stocks->links() }}

{{ $stocks->where('availability_status', 'in_stock')->count() }}

In Stock

{{ $stocks->where('availability_status', 'out_of_stock')->count() }}

Out of Stock

{{ $stocks->where('availability_status', 'arriving')->count() }}

Arriving

{{ $stocks->where('is_approved', 0)->count() }}

Pending Approval

@endsection @push('script') @endpush