{{-- Collection Report (billed revenue, bucketed by status) in the house PDF style. --}} @extends('layouts.PdfReportLayout') @section('doc_title', 'Collection Report') @section('doc_subtitle', $docSubtitle) @section('meta') Period {{ $periodLabel }} Breakdown {{ $levelLabel }} Covering {{ $periodRange }} Financial Year {{ $fiscalLabel }} Region {{ $regionLabel }} Activity {{ $activityLabel }} Generated {{ $generatedAt }} Prepared By {{ $generatedBy }} @endsection @section('content') @php // #, name, each shown bucket, total $colCount = 3 + count($buckets); @endphp
{{ $tableTitle }}
@foreach($buckets as $bucket) @endforeach @forelse($rows as $index => $row) @foreach($buckets as $bucket) @endforeach @empty @endforelse @if(count($rows) > 0) @foreach($buckets as $bucket) @endforeach @endif
# {{ $firstColumn }}{{ $bucket['label'] }}Total
{{ $index + 1 }} {{ $row['name'] }} @if(!empty($row['code']))  {{ $row['code'] }} @endif {{ $money($row[$bucket['key']]) }}{{ $money($row['total']) }}
Nothing was billed for this selection.
Total {{ $money($totals[$bucket['key']]) }} {{ $money($totals['total']) }}
@php // The summary blocks are the applied search as a whole: total billed // and each bucket that is on show. // Colours go inline: mPDF does not reliably apply the layout's // descendant class selectors (.totals .t-pass) to these cells. $summary = array_merge( [['label' => 'Total Billed', 'value' => $money($totals['total']), 'color' => '#c2410c']], array_map(fn ($b) => [ 'label' => $b['label'], 'value' => $money($totals[$b['key']]), 'color' => match ($b['key']) { 'paid' => '#15803d', 'pending' => '#b91c1c', default => '#0f172a', }, ], $buckets) ); $cellWidth = round(100 / max(count($summary), 1), 2); @endphp @foreach($summary as $block) @endforeach
{{ $block['label'] }}
{{ $block['value'] }}
Basis: figures are what was billed in this period, grouped by each bill's current payment status on its generation date. Amounts are in Tanzanian Shillings.
@endsection