UniformFlow/resources/views/handovers/create.blade.php

13 lines
2.5 KiB
PHP

@extends('layouts.app')
@section('title', 'Handover '.$employee->name.' - UniformFlow')
@section('page-heading', 'Complete handover')
@section('content')
<section class="page-intro"><div><a class="back" href="{{ route('handovers.index') }}"> Exit handovers</a><span class="eyebrow">{{ $employee->employee_no }} / {{ $employee->department }}</span><h1>Clear {{ $employee->name }}.</h1><p>{{ $employee->issues->count() ? 'Choose the final outcome for every outstanding issue.' : 'No uniforms are outstanding. Complete a clear exit handover below.' }}</p></div></section>
<form method="POST" action="{{ route('handovers.store',$employee) }}">@csrf
<section class="panel"><div class="panel-head"><div><span class="eyebrow">Outstanding property</span><h2>{{ $employee->issues->sum(fn($issue) => $issue->outstanding_quantity) }} units to account for</h2></div></div>
@forelse($employee->issues as $index => $issue)<div class="handover-item"><div class="item-symbol">{{ strtoupper(substr($issue->variant->item->name,0,2)) }}</div><div class="grow"><strong>{{ $issue->variant->item->name }}</strong><small>Size {{ $issue->variant->size }} / {{ $issue->outstanding_quantity }} unit(s) / Issued {{ $issue->issued_at->format('d M Y') }}</small></div><input type="hidden" name="items[{{ $index }}][issue_id]" value="{{ $issue->id }}"><label>Outcome<select name="items[{{ $index }}][condition]" required><option value="reusable">Returned / reusable (add to returned stock)</option><option value="damaged">Returned / damaged (do not add)</option><option value="not_returned">Not returned (do not add)</option></select></label></div>@empty<div class="clear-handover-state"><span></span><div><strong>No outstanding uniforms</strong><small>This employee has no uniform property requiring an outcome.</small></div></div>@endforelse
</section>
<section class="panel handover-confirm"><div class="form-grid"><label>Last working / handover date<input type="date" name="handover_date" value="{{ old('handover_date',now()->toDateString()) }}" required></label><label>Clearance note<input name="notes" value="{{ old('notes') }}" placeholder="Optional notes"></label></div><div class="warning-box"><strong>This completes employee clearance.</strong><span>The employee will be marked as left. Reusable items will enter returned stock.</span></div><button class="button danger-button" type="submit" onclick="return confirm('Complete this handover and mark the employee as left?')">Complete handover</button></section>
</form>
@endsection