@php // Payslip document. $preview = true renders for an on-screen browser view. $preview = $preview ?? false; $accent = $setting?->primary_color ?: '#124a61'; $ink = '#111827'; $muted = '#6b7280'; $soft = '#9ca3af'; $line = '#e5e7eb'; $wash = '#f8fafc'; $font = $setting?->font_family ? $setting->font_family.', Arial, sans-serif' : 'Arial, Helvetica, sans-serif'; $logoData = null; if ($setting?->logo_path) { try { $logoFull = \Illuminate\Support\Facades\Storage::disk('public')->path($setting->logo_path); if (is_file($logoFull)) { $logoData = 'data:'.(mime_content_type($logoFull) ?: 'image/png').';base64,'.base64_encode(file_get_contents($logoFull)); } } catch (\Throwable $e) { $logoData = null; } } $companyName = $setting?->company_name ?: $line_->team?->name; $money = fn ($v) => trim(($symbol ?: ($baseCode.' ')).number_format((float) $v, 2)); $allowances = $line_->slipRows('allowances'); $benefits = $line_->slipRows('benefits'); $componentDeductions = $line_->slipRows('deductions'); $employerCosts = $line_->slipRows('employer'); $earnings = (array) ($line_->breakdown['earnings'] ?? []); $commissions = (array) ($line_->breakdown['commissions'] ?? []); $otherDeductions = (array) ($line_->breakdown['deductions'] ?? []); $unpaid = (array) ($line_->breakdown['unpaid'] ?? []); $unpaidRows = (array) ($unpaid['rows'] ?? []); $earningLabels = ['overtime' => __('Overtime'), 'leave_cash' => __('Leave cash-out')]; $earningUnits = ['overtime' => __('hrs'), 'leave_cash' => __('days')]; // The name on the ID, snapshotted onto the slip when the run was built, so // a reprint keeps the name the pay was actually made out to. The account // name is only a stand-in for records filled in before full names existed. $employeeName = trim((string) ($line_->breakdown['full_name'] ?? '')) ?: ($profile?->legalName() ?: $line_->user?->name); // The statutory rows carry their own workings ("4.5% of insurable // earnings"), snapshotted at build time, so the slip states the rules it // was actually computed under without a paragraph restating them. $targetNet = $line_->breakdown['target_net'] ?? null; @endphp
|
@if ($logoData)
{{ $companyName }}
@endif
|
{{ __('Payslip') }}
{{ __('Pay period') }}: {{ $period->format('F Y') }}
{{ __('Issued') }}: {{ $issuedOn->format('d M Y') }}
@if ($line_->payslip_number)
{{ $line_->payslip_number }}
@endif
|
|
{{ __('Employee') }}
{{ $employeeName ?: __('Unknown') }}
|
{{ __('Employee no.') }}
{{ $profile?->employee_number ?: '—' }}
|
{{ __('Job title') }}
{{ $profile?->job_title ?: '—' }}
|
{{ __('Department') }}
{{ $profile?->department ?: '—' }}
|
|
{{ __('Engagement') }}
{{ $profile?->employmentTypeLabel() ?? '—' }}
|
{{ __('Date joined') }}
{{ $profile?->hired_on?->format('d M Y') ?: '—' }}
|
{{ __('National ID') }}
{{ $profile?->national_id ?: '—' }}
|
{{ __('Currency') }}
{{ $baseCode }}
|
|
{{ __('Not part of your net pay.') }}
@endif
|
||||||||||||||||||||||||||||||||
|
{{ __('Net pay') }}
{{ $money($line_->net_pay) }}
|
{{ __('Method') }}
{{ $line_->payMethodLabel() }}
|
{{ __('Paid by') }}
{{ $companyName }}
|
| {{ $row['label'] }} {{ __('taxed in the month it was earned') }} | {{ $money($row['amount']) }} |
| {{ __('Paid now') }} | {{ $money($line_->amountPaidNow() + $arrearsPaid_) }} |
| {{ __('Owed to you') }} {{ $line_->pay_deferred ? __('deferred to next month') : __('to be paid later') }}{{ $line_->paid_now_reason ? ' · '.$line_->paid_now_reason : '' }} | {{ $money($line_->amountOwed()) }} |
| {{ $companyName }} | {{ __('Employee signature') }} |