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

{{ strtoupper($letter_title) }}


@if (is_array($agents) && count($agents) > 1) @else @if (is_array($agents)) @foreach ($agents as $agentId => $agentDetails) AGENT NAME: {{ $agentDetails['name'] }}
@endforeach @endif @endif REPORT DATE: {{ $date_range }}
PRINTED AT: {{ $printed_at }}
@endsection @section('content')
@foreach ($parcel_informations as $index => $parcel_information) @endforeach
S.N Receipt Sender Parcel Type Receiver From Destination Rate Created At
{{ $index + 1 }} {{ $parcel_information['tracking_number'] }} {{ strtoupper($parcel_information['sender']['name']) }} @if (isset($parcel_information['parcels'][0])) {{ $parcel_information['parcels'][0]['parcel_type'] }} @else N/A @endif {{ strtoupper($parcel_information['receiver_detail']['name']) ?? 'N/A' }} @if (isset($parcel_information['parcels'][0]['origin_city'])) {{ $parcel_information['parcels'][0]['origin_city'] }} @else N/A @endif @if (isset($parcel_information['parcels'][0]['destination_city'])) {{ $parcel_information['parcels'][0]['destination_city'] }} @else N/A @endif {{ number_format($parcel_information['total_amount']) }} {{ Carbon\Carbon::parse($parcel_information['created_at'])->format('M d, Y - H:m:s') }}
TOTAL @php $total_amount = collect($parcel_informations)->sum('total_amount'); echo number_format($total_amount); @endphp
@endsection