@php
$day = fn ($v) => $v ? \Illuminate\Support\Carbon::parse($v)->format('d/m/Y') : '-';
$tzs = fn ($v) => $v !== null && $v !== '' ? 'TZS '.number_format((float) $v, 2) : '-';
$officer = $compound->officer ? trim($compound->officer->first_name.' '.$compound->officer->last_name) : null;
$paid = $bill ? (float) $bill['paidAmount'] : 0;
@endphp
{{-- The cover of the complete case file: the case at a glance, and the documents that follow it. --}}
| Customer | {{ $customer['name'] ?? ($inspection?->customer_name ?: '-') }} | Customer Code | {{ $customer['code'] ?? '-' }} |
| Phone | {{ $customer['phone'] ?? '-' }} | Email | {{ $customer['email'] ?? '-' }} |
| TIN | {{ $customer['tin'] ?? '-' }} | Location | {{ collect([$inspection?->street, $inspection?->ward, $inspection?->district, $inspection?->region])->filter()->implode(', ') ?: '-' }} |
| Offender | {{ $compound->offender_name ?: '-' }} | Offender Phone | {{ $compound->offender_phone ?: '-' }} |
| Offender Address | {{ $compound->offender_address ?: '-' }} |
| 1 | Case File cover (this page) | Included |
@foreach ($contents as $i => $part)
| {{ $i + 2 }} |
{{ $part['title'] }} |
{{ $part['included'] ? 'Included' : 'Could not be produced' }} |
@endforeach