@php $canSeeCost = auth()->user()->can('view-cost-prices'); $low = $part->min_stock > 0 && $onHand <= $part->min_stock; @endphp ← Parts

{{ $part->fullName() }}

{{ $part->sku }} · {{ $part->category->name }}@if ($part->subcategory) › {{ $part->subcategory->name }}@endif @if ($part->brand) · {{ $part->brand->name }} @endif @if ($part->parent) · Variant of {{ $part->parent->name }} @endif @unless ($part->is_active) · Turned off @endunless

@can('update', $part)
@if ($part->is_active) + Stock in @endif @unless ($part->parent_id) + Variant @endunless Edit
@endcan
{{-- Stock --}}
$onHand <= 0, 'bg-amber-50 ring-1 ring-amber-200' => $onHand > 0 && $low, 'bg-white' => $onHand > 0 && ! $low, ])>

In stock

{{ $onHand }} {{ $part->unit?->value }}

@if ($onHand <= 0) Out of stock. @elseif ($low) Low stock. @endif Minimum: {{ $part->min_stock ?: 'not set' }}

@if ($reserved > 0)

{{ $reserved }} reserved for jobs · {{ $onHand - $reserved }} available

@endif
@if ($part->location)

Shelf / bin

{{ $part->location }}

@endif
{{-- Details --}}
@if ($part->photo_path) {{ $part->name }} @endif
@can('view-prices')
Retail price
Rs. {{ number_format($part->selling_price, 2) }}
@foreach ($levels as $level)
{{ $level->name }} price
Rs. {{ number_format($part->priceFor($level), 2) }}
@endforeach
Minimum selling price
{{ $part->min_selling_price !== null ? 'Rs. '.number_format($part->min_selling_price, 2) : 'No minimum' }}
@endcan @if ($canSeeCost)
Cost price (average)
Rs. {{ number_format($part->cost_price, 2) }}
@endif
Quality
@if ($part->grade) {{ $part->grade->label() }} @else Not set @endif
Barcode
{{ $part->barcode ?? '—' }}
Unit
{{ $part->unit?->label() }}
Warranty
{{ $part->warranty_days !== null ? $part->warranty_days.' days' : 'Settings default ('.setting('warranty_days_parts').' days)' }}
Tax category
{{ $part->tax_category?->label() }}
Serialized
{{ $part->is_serialized ? 'Yes — each unit has its own serial' : 'No' }}
@if ($part->notes)
Notes
{{ $part->notes }}
@endif
{{-- Serial numbers / labels --}} @if ($part->is_serialized)

Units (serial numbers)

@can('view-prices') @if ($shelfUnits->isNotEmpty()) Print labels ({{ $shelfUnits->count() }}) @endif @endcan
@foreach (\App\Enums\StockUnitStatus::cases() as $status) @if ($unitCounts[$status->value] ?? 0) {{ $status->label() }}: {{ $unitCounts[$status->value] }} @endif @endforeach
@if ($missingCodes > 0)
{{ $missingCodes }} in stock without a unit code. They cannot be used until they have one. @can('manage-stock')
@csrf
@endcan
@endif @if ($shelfUnits->isEmpty())

No units on the shelf.

@else
    @foreach ($shelfUnits as $u)
  • {{ $u->unit_code }} @if ($u->serial_no) · {{ $u->serial_no }} @endif {{ $u->status->label() }}{{ $u->repairJob ? ' · '.$u->repairJob->job_no : '' }}
  • @endforeach
@endif
@else @can('view-prices')

Barcode: {{ $part->barcode ? 'supplier EAN '.$part->barcode : 'product code '.$part->sku }}.

@endcan @endif {{-- Variants --}} @if ($family->isNotEmpty())

Variants

    @foreach ($family as $v)
  • @if ($v->is($part)) {{ $v->variant_name ?? 'Main product' }} (this one) @else {{ $v->variant_name ?? 'Main product' }} @endif {{ $v->sku }} @unless ($v->is_active) Turned off @endunless {{ $v->stock_on_hand }} in stock @can('view-prices') · Rs. {{ number_format($v->selling_price, 2) }} @endcan
  • @endforeach
@endif {{-- Compatible models --}}

Fits these models

@if ($part->deviceModels->isEmpty())

No models added yet.

@else
    @foreach ($part->deviceModels->sortBy('full_name', SORT_NATURAL) as $model)
  • {{ $model->full_name }} @if ($model->deviceType) · {{ $model->deviceType->name }} @endif
  • @endforeach
@endif
{{-- Stock history --}}

Stock history (latest 20, this branch)

@can('manage-stock') Adjust @endcan Full history
@if ($movements->isEmpty())

No stock movements yet.

@else
    @foreach ($movements as $move)
  • {{ $move->type->label() }}

    {{ $move->created_at->format('d M Y, g:i A') }} @if ($move->createdBy) · {{ $move->createdBy->name }} @endif @if ($move->repairJob) · Job {{ $move->repairJob->job_no }} @endif @if ($move->reference_type === 'purchase_item' && $canSeeCost && $move->note) · {{ $move->note }} @endif

    @if ($move->note)

    {{ $move->note }}

    @endif

    $move->quantity > 0, 'text-red-700' => $move->quantity < 0])> {{ $move->quantity > 0 ? '+' : '−' }}{{ abs($move->quantity) }}

    @if ($canSeeCost)

    @ Rs. {{ number_format($move->unit_cost, 2) }}

    @endif
  • @endforeach
@endif
{{-- Price history (prices: admin and front desk; cost changes: admin only) --}} @can('view-prices')

Price history

@if ($history->isEmpty())

No price changes yet.

@else
@foreach ($history as $change) @endforeach
DatePriceOld NewHowBy
{{ $change->created_at->format('d M Y, g:i A') }} {{ $change->price_type === \App\Enums\PriceType::Level ? ($change->priceLevel?->name ?? 'Price level').' price' : $change->price_type->label() }} {{ $change->old_price !== null ? number_format($change->old_price, 2) : '—' }} {{ $change->new_price !== null ? number_format($change->new_price, 2) : '—' }} {{ $change->sourceLabel() }} {{ $change->changedBy?->name ?? 'System' }}
@endif
@endcan