@php // A consultant's payment advice: the document that goes back to somebody // engaged on a fee rather than employed. It is deliberately NOT a payslip. // Nothing here computes wages, nothing is withheld on their behalf, and it // says both of those out loud, because the difference is the whole point: // an "employee payslip" issued to a contractor is the paper ZIMRA reads as // an employment record. // // Shares the payslip's letterhead and styling so the company still speaks // with one voice; see pdf/partials/payslip-css.blade.php. $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)); $payeeName = trim((string) ($line_->breakdown['full_name'] ?? '')) ?: ($profile?->legalName() ?: $line_->user?->name); // A consultant carries none of the staff-wide catalogue, but anything // assigned to them by name is theirs and belongs on the advice. $extras = $line_->slipRows('allowances'); $deductions = $line_->slipRows('deductions'); $otherDeductions = (array) ($line_->breakdown['deductions'] ?? []); $earnings = (array) ($line_->breakdown['earnings'] ?? []); $earningLabels = ['overtime' => __('Additional hours'), 'leave_cash' => __('Leave cash-out')]; // What was actually bought. Their job title is the description of the // service on this document, so "Graphic design" is billed as graphic // design rather than as a nameless monthly fee. Read from the run's // snapshot first, so a reprint says what the engagement was at the time. $serviceTitle = trim((string) ($line_->breakdown['job_title'] ?? '')) ?: trim((string) $profile?->job_title); @endphp
|
@if ($logoData)
{{ $companyName }}
@endif
|
{{ __('Payment advice') }}
{{ __('For services rendered') }}
{{ __('Period') }}: {{ $period->format('F Y') }}
{{ __('Issued') }}: {{ $issuedOn->format('d M Y') }}
@if ($line_->payslip_number)
{{ $line_->payslip_number }}
@endif
|
|
{{ __('Paid to') }}
{{ $payeeName ?: __('Unknown') }}
|
{{ __('Engaged as') }}
{{ __('Consultant') }}
|
{{ __('Services') }}
{{ $serviceTitle ?: __('Consultancy services') }}
|
{{ __('Currency') }}
{{ $baseCode }}
|
| {{ __('Description') }} | {{ __('Amount') }} |
|---|---|
| {{ $serviceTitle ?: __('Consultancy fee') }} {{ __('Agreed monthly fee') }} · {{ $period->format('F Y') }} | {{ $money($line_->base_salary) }} |
| {{ $row['label'] }} {{ $row['rule'] }} | {{ $money($row['amount']) }} |
| {{ $earningLabels[$row['type'] ?? ''] ?? __('Additional work') }} | {{ $money($row['amount'] ?? 0) }} |
| {{ __('Commission') }} | {{ $money($line_->commission_total) }} |
| {{ __('Total fee') }} | {{ $money($line_->gross_pay) }} |
| {{ __('Description') }} | {{ __('Amount') }} |
|---|---|
| {{ $row['label'] }} {{ $row['rule'] }} | {{ $money($row['amount']) }} |
| @if (isset($row['loan_id'])) {{ __('Advance repayment') }} @else {{ __('Recovery') }}{{ ($row['reason'] ?? null) ? ' · '.$row['reason'] : '' }} @endif @isset($row['balance_after']) {{ __('Balance after this') }}: {{ $money($row['balance_after']) }} @endisset | {{ $money($row['amount'] ?? 0) }} |
| {{ __('Total withheld') }} | {{ $money($line_->deduction_total) }} |
|
{{ __('Amount paid') }}
{{ $money($line_->net_pay) }}
|
{{ __('Method') }}
{{ $line_->payMethodLabel() }}
|
{{ __('Paid by') }}
{{ $companyName }}
|
| {{ $companyName }} | {{ __('Received by') }} |