{{ __('Part Details') }}
@if (session('status'))
{{ session('status') }}
@endif

{{ $part->name }}

{{ $part->category }}

@include('parts._stock_badge', ['stock' => $currentStock])
@foreach ([ 'Part Number' => $part->part_number, 'Barcode' => $part->barcode, 'Supplier' => $part->supplier?->name, 'Unit' => $part->unit, 'Minimum Stock Level' => $part->min_stock_level.' '.$part->unit, 'Unit Cost' => number_format((float) $part->unit_cost, 2), 'Location / Shelf' => $part->location, ] as $label => $value)
{{ __($label) }}
@if ($label === 'Supplier' && $part->supplier) {{ $value }} @else {{ $value !== '' && $value !== null ? $value : '—' }} @endif
@endforeach @if ($part->notes)
{{ __('Notes') }}
{{ $part->notes }}
@endif

{{ __('Stock Ledger') }}

{{ __('Append-only. Correct a mistake with an adjustment entry.') }}

{{ __('Record Movement') }}
@if ($part->stockMovements->isEmpty())

{{ __('No stock movements recorded yet.') }}

@else
@foreach ($part->stockMovements as $movement) @endforeach
{{ __('Date') }} {{ __('Type') }} {{ __('Qty') }} {{ __('Cost') }} {{ __('Detail') }} {{ __('Reference') }} {{ __('By') }}
{{ $movement->date->format('M j, Y') }} {{ $movement->type->label() }} {{ $movement->quantity > 0 ? '+' : '' }}{{ $movement->quantity }} {{ $movement->unit_cost !== null ? number_format((float) $movement->unit_cost, 2) : '—' }} @if ($movement->supplier) {{ __('From') }} {{ $movement->supplier->name }} @elseif ($movement->vehicle) {{ __('To') }} {{ $movement->vehicle->plate }}@if ($movement->mechanic) · {{ $movement->mechanic->name }}@endif @else — @endif {{ $movement->reference ?: '—' }} {{ $movement->recordedBy?->name ?: '—' }}
@endif
← {{ __('Back to Parts') }}