@extends('layouts.pdf-layout') @section('letter_title')

{{ strtoupper($letter_title) }}


REPORT DATE: {{ $selectedDateRange }}
PRINTED AT: {{ $print_time }}
@endsection @section('content') @foreach($allAgents as $agentId => $agentName) @endforeach @php $columnTotals = array_fill_keys(array_keys($allAgents), 0); $grandTotal = 0; @endphp @foreach($routes as $route => $data) @foreach($allAgents as $agentId => $agentName) @endforeach @php $grandTotal += $data['total_rate']; @endphp @endforeach @foreach($allAgents as $agentId => $agentName) @endforeach
ROUTE{{ strtoupper($agentName) }}TOTAL
{{ $route }} @if(isset($data['agents'][$agentId])) {{ number_format($data['agents'][$agentId]['total_rate'], 2) }} @php $columnTotals[$agentId] += $data['agents'][$agentId]['total_rate']; @endphp @else - @endif {{ number_format($data['total_rate'], 2) }}
TOTAL{{ number_format($columnTotals[$agentId], 2) }}{{ number_format($grandTotal, 2) }}
@endsection