@php $addressParts = array_filter([ $company->address ?? null, $company->city ?? null, $company->country ?? null, ]); $companyAddress = implode(', ', $addressParts); $fmt = fn ($n) => number_format((float) $n, 2); $salutation = fn ($emp) => trim(($emp->salutation ? $emp->salutation . ' ' : '') . ($emp->display_name ?: $emp->name)); $amountLabel = $sheet['amount_label'] ?? 'Amount'; $filterParts = ['Department: ' . ($sheet['filters']['department'] ?: 'All')]; if ($sheet['show_religion_filter'] ?? true) { $filterParts[] = 'Religion: ' . ($sheet['filters']['religion'] ?: 'All'); } $filterParts[] = 'Status: ' . ($sheet['status_label'] ?? 'draft'); @endphp {{ $sheet['type_label'] }} — {{ $sheet['period_label'] }}{{ $sheet['is_draft'] ? ' (Draft)' : '' }}
@if($sheet['is_draft'] ?? false) @endif
{{ implode(' | ', $filterParts) }}
{{ $company->name ?? 'Company' }}
@if($companyAddress)
{{ $companyAddress }}
@endif
{{ $sheet['type_label'] }}
For the Month of {{ $sheet['period_label'] }}
@if(!empty($sheet['voucher_no']) && $sheet['voucher_no'] !== 'DRAFT')
Voucher No: {{ $sheet['voucher_no'] }}
@endif @if(empty($sheet['department_groups']))
{{ $sheet['empty_message'] ?? 'No employees match the selected filters.' }}
@else @foreach($sheet['department_groups'] as $group) @foreach($group['rows'] as $row) @php $emp = $row['employee']; @endphp @endforeach @endforeach
Employee ID Name Designation Paymt Method {{ $amountLabel }}
Department: {{ $group['name'] }}
{{ $emp->code }} {{ $salutation($emp) }} {{ $emp->designation ?: '—' }} {{ $emp->salary_payment_method ?: '—' }} {{ $fmt($row['amount']) }}
Subtotal — {{ $group['name'] }} ({{ count($group['rows']) }}) {{ $fmt($group['subtotal']['amount']) }}
Department-wise Summary
@foreach($sheet['department_summary'] as $summary) @endforeach
Department Emp {{ $amountLabel }}
{{ $summary['department'] }} {{ $summary['employee_count'] }} {{ $fmt($summary['amount']) }}
Grand Total {{ $sheet['employee_count'] }} {{ $fmt($sheet['grand_total']) }}
{{ $sheet['payment_summary_title'] ?? 'Payment Method Summary' }}
@foreach($sheet['payment_summary'] as $payment) @endforeach
Payment Method Employees {{ $amountLabel }}
{{ $payment['method'] }} {{ $payment['employee_count'] }} {{ $fmt($payment['amount']) }}
Total {{ $sheet['employee_count'] }} {{ $fmt($sheet['grand_total']) }}
Prepared By
Checked By
Approved By
@endif