{{-- A saved Company Document Requisition Form laid out as the issued CDRF prints it: the masthead, the companies, the four header fields, the FORM / QUANTITY / REMARKS table with a tick against what was asked for, and the four sign-offs at the foot. Shared by the browser print view and the dompdf export; $forPdf switches to a font dompdf embeds and trims the sizes to hold one A4 page. Nothing here is a control — the sheet is filled in on cdrf/sheet.blade.php. --}} @php use App\Models\DocumentRequisition; $forPdf = $forPdf ?? false; $logo = $forPdf ? public_path('img/gintell-logo.jpg') : asset('img/gintell-logo.jpg'); $logoExists = is_file(public_path('img/gintell-logo.jpg')); $tick = fn (bool $on) => $on ? '✓' : ' '; $date = fn ($value) => $value ? \Illuminate\Support\Carbon::parse($value)->format('d/m/Y') : ''; @endphp Company Document Requisition Form (CDRF) — {{ $proposal->outlet }} @unless ($forPdf)
Back to the requisitions
@endunless {{-- ---------------------------------------------------------- --}} {{-- 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 --}} {{-- ---------------------------------------------------------- --}}
Purpose : {{ $requisition->purpose }}
Department / Showroom : {{ $requisition->department }}
Required By : {{ $requisition->required_by }}
Required Date : {{ $date($requisition->required_date) }}
{{-- ---------------------------------------------------------- --}} {{-- What is being asked for --}} {{-- ---------------------------------------------------------- --}} @foreach (DocumentRequisition::documents() as $key => $label) @php $row = $requisition->item($key); @endphp @endforeach
FORM QUANTITY REMARKS
{!! $tick($row['ticked']) !!} {{ $label }} @if ($key === DocumentRequisition::OTHERS) {{ $row['label'] }} @endif {{ $row['quantity'] }} {{ $row['remarks'] }}
{{-- ---------------------------------------------------------- --}} {{-- Sign-off: asked for, approved, issued, received --}} {{-- ---------------------------------------------------------- --}} @foreach (array_chunk(DocumentRequisition::signOffs(), 2, true) as $pair) @foreach ($pair as $signOff) @endforeach @endforeach
{{ $signOff['heading'] }} :
Name : {{ $requisition->{$signOff['name_field']} }}
Date : {{ $date($requisition->{$signOff['date_field']}) }}