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

SUB ROUTE PARCEL DISPATCH MANIFEST, DATE {{ $date }}

VEHICLE: {{ $vehicle }}
DRIVER: {{ strtoupper($driver) }}
HANDLER: {{ strtoupper($handler) }}
@endsection @section('content')
@foreach ($groupedParcels as $route => $parcels) @php $rowspan = count($parcels); @endphp @foreach ($parcels as $index => $parcel) {{-- Add rowspan only on the first parcel of a route --}} @if ($loop->first) @endif @endforeach @endforeach
S.N Pax No Receipt Origin Destination Consignor Consignee Quantity Amount Mark Sign
{{ $route }}
{{ $loop->iteration }} {{ $parcel->id }} {{ $parcel->tracking_number }} {{ $parcel->parcelInformation && $parcel->parcelInformation->originOffice && $parcel->parcelInformation->originOffice->branch ? $parcel->parcelInformation->originOffice->branch->name : '' }} {{ $parcel->destinationOffice && $parcel->destinationOffice->branch ? $parcel->destinationOffice->branch->name : '' }} {{ strtoupper($parcel->parcelInformation->sender->name) }} {{ strtoupper($parcel->receiver ? $parcel->receiver->name : '') }} {{ $parcel->quantity }} {{ number_format($parcel->rate) }}
_____________
TOTAL @php $total_rate_amount = collect($groupedParcels)->flatten()->sum('rate'); echo number_format($total_rate_amount); @endphp
@endsection