{{-- The Company Document Requisition Form as it is filled in: laid out the way the issued CDRF prints, but with every line a control — the four header fields, a tick box, quantity and remarks on each document, and a name and date under each of the four sign-offs. Kept out of the app chrome so the bare element styling below cannot reach anything else, and so whoever is filling it in sees the sheet rather than a screen full of form rows. The saved form prints from cdrf/print.blade.php. --}} @php use App\Models\DocumentRequisition; $logo = asset('img/gintell-logo.jpg'); $logoExists = is_file(public_path('img/gintell-logo.jpg')); $isNew = ! $requisition->exists; $action = $isNew ? route('proposals.cdrf.store', $proposal) : route('proposals.cdrf.update', [$proposal, $requisition]); // What is on screen: what was typed and rejected, else what is stored. $value = fn (string $field, $fallback = null) => old($field, $fallback ?? $requisition->{$field}); $date = function (string $field) use ($requisition) { $stored = $requisition->{$field}; return old($field, $stored ? $stored->format('Y-m-d') : ''); }; $item = function (string $key) use ($requisition) { $stored = $requisition->item($key); if (old('document') !== null) { $stored['ticked'] = in_array($key, (array) old('document', []), true); $stored['quantity'] = (string) (old('quantity')[$key] ?? ''); $stored['remarks'] = (string) (old('remarks')[$key] ?? ''); $stored['label'] = (string) old('other_label', ''); } return $stored; }; @endphp {{ $isNew ? 'New' : $requisition->reference }} — Company Document Requisition Form
@csrf @unless ($isNew) @method('PUT') @endunless
{{ $isNew ? 'New requisition' : $requisition->reference }} {{ $proposal->outlet }} Cancel
@if ($errors->any())
This form cannot be saved yet:
@endif
{{-- ------------------------------------------------------ --}} {{-- Masthead --}} {{-- ------------------------------------------------------ --}}
@if ($logoExists) Gintell @else GINTELL @endif
@foreach (DocumentRequisition::companies() as $column) @endforeach
@foreach ($column as $company)
{{ $company }}
@endforeach

COMPANY DOCUMENT REQUISITION FORM

{{-- ------------------------------------------------------ --}} {{-- Who is asking, and by when --}} {{-- ------------------------------------------------------ --}} @foreach (DocumentRequisition::headerFields() as $field => $label) @endforeach
{{ $label }} : @if ($field === 'required_date') @else @endif
{{-- ------------------------------------------------------ --}} {{-- What is being asked for --}} {{-- ------------------------------------------------------ --}} @foreach (DocumentRequisition::documents() as $key => $label) @php $row = $item($key); @endphp $row['ticked']])> @endforeach
FORM QUANTITY REMARKS
{{ $label }} {{-- "Others :" is written in as well as ticked. --}} @if ($key === DocumentRequisition::OTHERS) @endif
{{-- ------------------------------------------------------ --}} {{-- Sign-off: asked for, approved, issued, received --}} {{-- ------------------------------------------------------ --}} @foreach (array_chunk(DocumentRequisition::signOffs(), 2, true) as $row) @foreach ($row as $key => $signOff) @endforeach @endforeach
{{ $signOff['heading'] }} :
Name :
Date :

Saved against the proposal for {{ $proposal->outlet }}. Print it from the requisition list once it is saved, or open the blank form as issued.