@php $chunkSize = 45; $earnings = $summaryDataEarnings->values(); $deductions = $summaryDataDeductions->values(); $contributions = $summaryDataContributions->values(); $maxRows = max($earnings->count(), $deductions->count(), $contributions->count()); $numPages = ceil($maxRows / $chunkSize); @endphp {{-- Watermark --}} {{--
HIGHLY CONFIDENTIAL
--}}
Watermark Logo
CONFIDENTIAL
Logo

Payroll Register Summary

{{ $pamPayRunPeriod->calendar_month }} - {{ $pamPayRunPeriod->calendar_year }}

{{ $pamEmpUnit ? $pamEmpUnit->name : 'All Units' }}

Executive Summary
Payroll Name {{ $pamPayroll->short_description ?? 'N/A' }}
Period {{ \Carbon\Carbon::parse($pamPayRunPeriod->start_date)->format('Y-m-d') }} to {{ \Carbon\Carbon::parse($pamPayRunPeriod->end_date)->format('Y-m-d') }}
Total Employees {{ $totalEmployees ?? 'N/A' }}
Total Gross Pay {{ number_format($totalEarnings ?? 0, 2, '.', ',') }}
Total Basic Pay {{ number_format($totalBasic ?? 0, 2, '.', ',') }}
Total Deductions {{ number_format($totalDeductions ?? 0, 2, '.', ',') }}
Net Pay {{ number_format($totalNetPay ?? 0, 2, '.', ',') }}


@for ($page = 0; $page < $numPages; $page++) @php $chunkStart=$page * $chunkSize; $earnChunk=$earnings-> slice($chunkStart, $chunkSize)->values(); $deduChunk = $deductions->slice($chunkStart, $chunkSize)->values(); $contChunk = $contributions->slice($chunkStart, $chunkSize)->values(); $chunkMax = max($earnChunk->count(), $deduChunk->count(), $contChunk->count()); @endphp @if ($page > 0)
@endif
@for ($i = 0; $i < $chunkMax; $i++) @endfor
1. Contributions
Description Amount
{{ $contChunk[$i]->short_description ?? '' }} {{ isset($contChunk[$i]) ? number_format($contChunk[$i]->fixed_amount, 2, '.', ',') : '' }}
@for ($i = 0; $i < $chunkMax; $i++) @endfor
2. Deductions
Description Amount
{{ $deduChunk[$i]->short_description ?? '' }} {{ isset($deduChunk[$i]) ? number_format($deduChunk[$i]->fixed_amount, 2, '.', ',') : '' }}
@for ($i = 0; $i < $chunkMax; $i++) @php if ($earnChunk[$i]->earn_type_code === 'BASIC') { $code = $earnChunk[$i]->basic_pay_code ?? ''; $desc = $code !== '' ? ($code . ' Basic Pay') : 'Basic Pay'; } else { $desc = $earnChunk[$i]->short_description ?? ''; } @endphp @endfor
3. Earnings
Description Amount
{{ $desc }} {{ isset($earnChunk[$i]) ? number_format($earnChunk[$i]->fixed_amount, 2, '.', ',') : '' }}
@endfor
Prepared By


{{ auth()->user()->name ?? auth()->user()->username ?? 'N/A' }}

Date: {{ \Carbon\Carbon::now()->format('d-m-Y H:i') }}
Approved By


___________________________

Date: ___________
Confidential • Payroll Summary • {{ now()->format('F j, Y, g:i A') }}