{{--
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)
@endunless
{{-- ---------------------------------------------------------- --}}
{{-- Masthead --}}
{{-- ---------------------------------------------------------- --}}
@if ($logoExists)

@else
GINTELL
@endif
@foreach (DocumentRequisition::companies() as $column)
|
@foreach ($column as $company)
{{ $company }}
@endforeach
|
@endforeach
COMPANY DOCUMENT REQUISITION FORM
{{-- ---------------------------------------------------------- --}}
{{-- Who is asking, and by when --}}
{{-- ---------------------------------------------------------- --}}
{{-- ---------------------------------------------------------- --}}
{{-- What is being asked for --}}
{{-- ---------------------------------------------------------- --}}
|
FORM |
QUANTITY |
@foreach (DocumentRequisition::documents() as $key => $label)
@php $row = $requisition->item($key); @endphp
| {!! $tick($row['ticked']) !!} |
{{ $label }}
@if ($key === DocumentRequisition::OTHERS)
{{ $row['label'] }}
@endif
|
{{ $row['quantity'] }} |
{{ $row['remarks'] }} |
@endforeach
{{-- ---------------------------------------------------------- --}}
{{-- Sign-off: asked for, approved, issued, received --}}
{{-- ---------------------------------------------------------- --}}
@foreach (array_chunk(DocumentRequisition::signOffs(), 2, true) as $pair)
@foreach ($pair as $signOff)
| {{ $signOff['heading'] }} : |
| Name |
: |
{{ $requisition->{$signOff['name_field']} }} |
| Date |
: |
{{ $date($requisition->{$signOff['date_field']}) }} |
|
@endforeach
@endforeach