{{ __('Maintenance Job') }}
@if (session('status'))
{{ session('status') }}
@endif

{{ $job->vehicle->plate }} — {{ $job->date_in->format('M j, Y') }}

{{ $job->workshopLabel() }} · {{ $job->type->label() }}

{{ $job->status->label() }}
{{ __('Edit') }}
{{ __('Labour Cost') }}
{{ number_format((float) $job->labour_cost, 2) }}
{{ __('Parts Cost') }}
{{ number_format((float) $job->parts_cost, 2) }}
{{ __('Total Cost') }}
{{ number_format((float) $job->total_cost, 2) }}
@foreach ([ 'Mechanic' => $job->mechanic?->name, 'Odometer' => $job->odometer ? number_format($job->odometer).' km' : null, 'Date Out' => $job->date_out?->format('M j, Y'), 'Description' => $job->description, ] as $label => $value)
{{ __($label) }}
{{ $value ?: '—' }}
@endforeach @if ($job->notes)
{{ __('Notes') }}
{{ $job->notes }}
@endif

{{ __('Parts Used') }}

{{ __('Issuing a part here records a stock-out and updates the parts cost above.') }}

@if ($job->partsUsed->isEmpty())

{{ __('No parts issued to this job yet.') }}

@else @foreach ($job->partsUsed as $movement) @endforeach
{{ __('Part') }} {{ __('Qty') }} {{ __('Unit Cost') }} {{ __('Cost') }}
{{ $movement->part->name }} {{ $movement->magnitude() }} {{ number_format((float) ($movement->unit_cost ?? 0), 2) }} {{ number_format($movement->magnitude() * (float) ($movement->unit_cost ?? 0), 2) }}
@endif
@csrf
← {{ __('Back to Maintenance') }}