@php $l = $line; $m = fn ($v) => '$ ' . number_format((float) $v, 2); $earn = collect([ 'Basic salary' => $l->basic_salary, 'Commission (' . (float) $l->commission_percent . '%)' => $l->commission_amount, 'Overtime (' . $l->overtime_minutes . ' min)' => $l->overtime_amount, 'Bonus / allowance' => $l->adjustment_bonus, ])->filter(fn ($v, $k) => $v > 0 || $k === 'Basic salary'); $ded = collect([ 'Absent days (' . (float) $l->absent_days . ')' => $l->absence_deduction, 'Unpaid leave (' . (float) $l->unpaid_leave_days . ' days)' => $l->unpaid_leave_deduction, 'Late (' . $l->late_count . ' times, ' . $l->late_minutes . ' min)' => $l->late_deduction, 'Left early (' . $l->early_minutes . ' min)' => $l->early_deduction, 'Deduction (' . (float) $l->deduction_percent . '%)' => $l->other_deduction, 'Other deduction' . ($l->adjustment_note ? ' — ' . $l->adjustment_note : '') => $l->adjustment_deduction, ])->filter(fn ($v) => $v > 0); @endphp
@include('layouts.print_header', ['printTitle' => 'Payslip — ' . $period, 'printSubtitle' => $run->isDraft() ? 'DRAFT — payroll not approved yet' : null]) @if ($staff?->attendance_exempt) @endif
Name: {{ $staff?->name ?? '—' }}Staff ID: {{ $staff?->id }}
Job title: {{ $jobTitle ?? '—' }}Department: {{ $departments ?? '—' }}
Period: {{ $period }}One day's pay: {{ $m($l->daily_rate) }}
Exempt from attendance deductions — full salary for the days employed.
Attendance
Working days {{ (float) $l->working_days }} Present {{ (float) $l->present_days }} Absent {{ (float) $l->absent_days }} Paid leave {{ (float) $l->paid_leave_days }} Unpaid leave {{ (float) $l->unpaid_leave_days }} Holidays {{ (float) $l->holiday_days }}
Late {{ $l->late_count }} times, {{ $l->late_minutes }} min Left early {{ $l->early_minutes }} min Overtime {{ $l->overtime_minutes }} min
@foreach ($earn as $k => $v) @endforeach
Earnings
{{ $k }}{{ $m($v) }}
Total earnings{{ $m($earn->sum()) }}
@forelse ($ded as $k => $v) @empty @endforelse
Deductions
{{ $k }}{{ $m($v) }}
None
Total deductions{{ $m($l->deduction_amount) }}
Net pay{{ $m($l->total) }}
Employee signature
Authorised by