@extends('garage.layouts.app') @section('title', 'Parts') @section('content') @push('styles') @include('shared.garage-summary-ui-styles') @endpush

Parts

{{--

Rows: garage_parts + garage_id · Master: spare_parts

--}}
@include('garage.partials.trash-link', ['trashType' => 'parts', 'class' => 'grg-sum-btn'])
{{-- Print barcode labels (brand + category) --}} {{-- Import Parts CSV Modal --}}
{{ $stats['total'] }}
Total Parts
Click for details
{{ $stats['active'] }}
Active
Click for details
{{ $stats['inactive'] }}
Inactive
Click for details
PKR {{ number_format($stats['avg_selling'], 0) }}
Avg. Selling
Click for details
@if($stats['low_stock'] > 0)
{{ $stats['low_stock'] }} below min — filter Low stock
@endif
@if($search || ($categoryId ?? '') || ($status ?? 'all') !== 'all') Clear @endif
Stock {{ $parts->total() }} {{ $parts->firstItem() ?? 0 }}–{{ $parts->lastItem() ?? 0 }} of {{ $parts->total() }}
@forelse($parts as $part) @php $stockClass = $part->stock_quantity <= $part->min_stock_level ? 'text-danger' : ($part->stock_quantity <= ($part->min_stock_level * 1.5) ? 'text-warning' : 'text-success'); @endphp @empty @endforelse
Inv no. Part no. / code Name Category Brand Unit Cost Selling Stock Status Act.
{{ $part->inventory_code ?? '—' }} @if($part->part_number) {{ $part->part_number }} @endif @if($part->code)
Barcode: {{ $part->code }}
@elseif(!$part->part_number) @endif
{{ $part->name }}
@if($part->description)
{{ \Illuminate\Support\Str::limit($part->description, 44) }}
@endif
@if($part->category_name) {{ $part->category_name }} @else @endif {{ $part->brand_name ?: '—' }} {{ $part->unit }} PKR {{ number_format($part->cost_price, 0) }} PKR {{ number_format($part->selling_price, 0) }} {{ $part->stock_quantity }} @if($part->min_stock_level > 0)
Min: {{ $part->min_stock_level }}
@endif
@if($part->is_active) Active @else Inactive @endif
No parts
@if($search || ($categoryId ?? '') || ($status ?? 'all') !== 'all')

Adjust filters or clear.

Clear @else

Add inventory for this garage.

@endif
@if($parts->hasPages())
Page {{ $parts->currentPage() }} / {{ $parts->lastPage() }} {{ $parts->links('vendor.pagination.bootstrap-5') }}
@endif
@push('styles') @include('shared.parts-modal-styles') @endpush @push('scripts') @endpush @endsection