@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. --}} Case File {{ $compound->compound_number }}
@if ($emblem)Coat of Arms@endif
THE UNITED REPUBLIC OF TANZANIA
MINISTRY OF INDUSTRY AND TRADE
WEIGHTS AND MEASURES AGENCY
@if ($logo)WMA@endif

COMPOUNDING CASE FILE

Jalada la Shauri la Ufifilishaji · {{ $statusLabel }}

Case

Compound No.{{ $compound->compound_number ?: '-' }}Compound Date{{ $day($compound->compound_date) }}
Inspection No.{{ $inspection?->inspection_number ?: '-' }}Inspection Date{{ $day($inspection?->inspection_date) }}
Instrument{{ $inspection?->instrument_inspected ?: ($inspection?->instrument_type ?: '-') }}
Compound Amount{{ $tzs($compound->compound_amount) }}Office{{ $compound->collection_center ?: '-' }}
Compounding Officer{{ $officer ?: '-' }}Approved{{ $day($compound->approved_at) }}
@if ($compound->offence_description)
Offence(s): {{ $compound->offence_description }}
@endif

Customer and Offender

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 ?: '-' }}

Bill and Payment

@if ($bill) @else @endif
Control Number{{ $bill['controlNumber'] }}Payment Status{{ $bill['cancelled'] ? 'Cancelled' : ($bill['paymentStatus'] ?: '-') }}
Billed{{ $tzs($bill['totalAmount']) }}Paid / Outstanding{{ $tzs($paid) }} / {{ $tzs($bill['outstandingAmount']) }}
Bill Date{{ $day($bill['generatedDate']) }}Receipts{{ count($receipts) ?: 'None yet' }}
No bill has been raised for this case yet.

Contents of this file

@foreach ($contents as $i => $part) @endforeach
1Case File cover (this page)Included
{{ $i + 2 }} {{ $part['title'] }} {{ $part['included'] ? 'Included' : 'Could not be produced' }}
Generated by WMA-MIS on {{ now()->format('d/m/Y H:i') }}{{ $generatedBy ? ' by '.$generatedBy : '' }}. Every document in this file is printed exactly as it was issued.