@php $money = fn ($value) => number_format((float) $value, 2); $date = fn ($value, $format = 'd M Y') => $value ? \Illuminate\Support\Carbon::parse($value)->format($format) : '-'; $status = \Modules\LegacyDebts\Enums\LegacyDebtStatus::tryFrom((string) $debt->status); $settledAmount = (float) $debt->settled_via_control_number_amount + (float) $debt->manually_settled_amount - (float) $debt->overpaid_amount; $latest = $debt->controlNumbers->sortByDesc('id')->first(fn ($link) => $link->control_number !== null); @endphp {{-- The heading is the rejection note's (resources/views/note.blade.php): coat of arms, the agency's name in small capitals, the WMA mark, the ornamental rules and the widely spaced title. What differs is the contact line, which is the debt's own office rather than a fixed one. Rendered by Chrome through PdfRenderingService, not mPDF - the fonts and SVG ornaments of that heading are ones mPDF cannot draw. --}}
Billed (TZS) {{ $money($debt->original_billed_amount) }} |
Paid (TZS) {{ $money($debt->paid_amount) }} |
Outstanding (TZS) {{ $money($debt->outstanding_amount) }} |
| Debt ID | {{ $debt->debt_number }} | Date | {{ $date($debt->bill_date) }} |
| Payer | {{ $debt->payer_name }} | ||
| Description | {{ $debt->description }} | ||
| Mobile | {{ $debt->mobile ?? '-' }} | Original control number | {{ $debt->original_control_number ?? '-' }} |
| Region | {{ $locations->regionName($debt->region_id) ?? '-' }} | District | {{ $locations->districtName($debt->district_id) ?? '-' }} |
| Office | {{ $locations->centreName($debt->collection_center) ?? '-' }} | Expiry | {{ $date($debt->original_expiry_date) }} |
| Generated by | {{ $debt->original_generated_by ?? '-' }} | Payment method | {{ \Modules\LegacyDebts\Enums\LegacyPaymentMethod::tryFrom((string) $debt->original_payment_method)?->label() ?? '-' }} |
| As imported | Billed {{ $money($debt->original_billed_amount) }} · Paid {{ $money($debt->original_paid_amount) }} · Outstanding {{ $money($debt->original_outstanding_amount) }} · {{ $debt->original_status_label ?? $debt->original_status }} | ||
No new control number has been generated for this debt.
@else| Control number | Generated | By | Amount | Paid | Expires | Status |
|---|---|---|---|---|---|---|
| {{ $link->control_number ?? 'Awaiting GePG' }} | {{ $date($link->generated_at, 'd M Y H:i') }} | {{ $link->generated_by_name }} | {{ $money($link->amount) }} | {{ $money($link->paid_amount) }} | {{ $date($link->expires_at) }} | {{ $link->statusEnum()->label() }} |
No payment has been received through this system.
@else| Date | Control number | Reference | Receipt | Channel | Amount (TZS) |
|---|---|---|---|---|---|
| {{ $date($payment->payment_date, 'd M Y H:i') }} | {{ $payment->control_number }} | {{ $payment->payment_reference }} | {{ $payment->receipt_number }} | {{ $payment->payment_channel }} | {{ $money($payment->amount) }} |
| {{ $date($manual->settlement_date) }} | Manual settlement {{ $manual->settlement_number }} | {{ $manual->reference }} | Approved by {{ $manual->reviewed_by_name }} | {{ $money($manual->amount) }} | |
| When | Status | Source | By | Outstanding |
|---|---|---|---|---|
| {{ $date($history->changed_at, 'd M Y H:i') }} | {{ \Modules\LegacyDebts\Enums\LegacyDebtStatus::tryFrom((string) $history->new_status)?->label() ?? $history->new_status }} | {{ \Modules\LegacyDebts\Enums\HistorySource::tryFrom((string) $history->source)?->label() ?? $history->source }} | {{ $history->changed_by_name }} | {{ $history->outstanding_amount !== null ? $money($history->outstanding_amount) : '-' }} |
Printed {{ now()->format('d M Y H:i') }}{{ $printedBy ? ' by '.$printedBy : '' }}. @if ($debt->import) Imported from {{ $debt->import->file_name }} ({{ $debt->import->import_number }}). @endif