@include('pdf._styles')
@if($logo)
@endif
{{ $company?->name }}
{{ $company?->address }}@if($company?->city), {{ $company->city }}, {{ $company->state }} {{ $company->zip }}@endif
@if($company?->phone_1)Tel: {{ $company->phone_1 }}@endif @if($company?->phone_2), {{ $company->phone_2 }}@endif
SETTLEMENT
{{ $settlement->settlement_no }}
{{ ucfirst($settlement->status) }}
Driver{{ $driverName }} @if($settlement->driver?->employee_code)({{ $settlement->driver->employee_code }})@endif Period{{ $settlement->period_start?->format('m/d/Y') }} – {{ $settlement->period_end?->format('m/d/Y') }}
Trips{{ $settlement->trips_count }} · {{ number_format($settlement->total_miles, 0) }} mi Paid@if($settlement->status === 'paid'){{ $settlement->paid_on?->format('m/d/Y') }} · {{ ucfirst((string) $settlement->payment_method) }}@if($settlement->payment_ref) · {{ $settlement->payment_ref }}@endif @else — @endif

Trips

{{-- grouped by trip: this driver's wage (and hours), then that trip's reimbursements / deductions --}} @php($sign = ['deduction' => '−', 'reimbursement' => '+', 'bonus' => '+']) @forelse($trips as $t) @php($team = $t->drivers->where('employee_id', '!=', $settlement->driver_id)) @foreach($items->where('trip_id', $t->id) as $i) @endforeach @empty @endforelse
TripDateLoadRouteTruckMilesHoursAmount
{{ $t->trip_no }}{{ $t->trip_date?->format('m/d/Y') }}{{ $t->load_no }} {{ $t->load_from_city }}@if($t->load_from_state), {{ $t->load_from_state }}@endif → {{ $t->destination_city }}@if($t->destination_state), {{ $t->destination_state }}@endif @if($team->isNotEmpty())
Team: {{ $team->map(fn ($r) => trim(($r->employee?->first_name ?? '').' '.($r->employee?->last_name ?? '')).($r->is_main ? ' (main)' : ''))->implode(', ') }}
@endif
{{ $t->truck?->truck_no }} {{ number_format($t->total_miles, 0) }} {{ $t->pivot->hours !== null ? rtrim(rtrim(number_format((float) $t->pivot->hours, 1), '0'), '.') : '' }} ${{ number_format((float) $t->pivot->driver_pay, 2) }}
{{ $i->description }} {{ $sign[$i->type] ?? '' }}${{ number_format($i->amount, 2) }}
No trips.
@php($other = $items->filter(fn ($i) => ! $i->trip_id || ! $trips->contains('id', $i->trip_id))) @if($other->isNotEmpty())

Other lines

@foreach($other as $i) @endforeach
{{ $i->description }}@if(!$i->is_auto) (manual)@endif {{ $sign[$i->type] ?? '' }}${{ number_format($i->amount, 2) }}
@endif
Gross pay${{ number_format($settlement->gross_pay, 2) }}
+ Reimbursements${{ number_format($settlement->reimbursements, 2) }}
− Deductions${{ number_format($settlement->deductions, 2) }}
+ Bonuses${{ number_format($settlement->bonuses, 2) }}
NET PAY${{ number_format($settlement->net_pay, 2) }}
@if($settlement->notes)

Notes

{{ $settlement->notes }}
@endif
{{ $company?->name }} · Settlement {{ $settlement->settlement_no }} · Generated {{ now()->format('m/d/Y H:i') }}