@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 {{ $line_->payslip_number ?: __('Payment advice') }}, {{ $payeeName }}
{{-- ---------------------------------------------------------------- --}}
@if ($logoData) @else
{{ $companyName }}
@endif
@if ($logoData){{ $companyName }}
@endif @if ($setting?->address){{ $setting->address }}
@endif @if ($setting?->phone){{ $setting->phone }}@endif @if ($setting?->email) · {{ $setting->email }}@endif @if ($setting?->tin_number)
{{ __('TIN') }}: {{ $setting->tin_number }}@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
{{-- Who was paid. Not an employee panel: no employee number, no date joined, no national ID, because none of that is the company's business about somebody it has not employed. --}}
{{ __('Paid to') }}
{{ $payeeName ?: __('Unknown') }}
{{ __('Engaged as') }}
{{ __('Consultant') }}
{{ __('Services') }}
{{ $serviceTitle ?: __('Consultancy services') }}
{{ __('Currency') }}
{{ $baseCode }}
{{-- The fee. One table, full width: there is no second column of deductions to set it against unless something was actually deducted. --}} @foreach ($extras as $row) @endforeach @foreach ($earnings as $row) @endforeach @if ((float) $line_->commission_total > 0) @endif
{{ __('Fee for services') }}
{{ __('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) }}
@if ($deductions || $otherDeductions) @foreach ($deductions as $row) @endforeach @foreach ($otherDeductions as $row) @endforeach
{{ __('Amounts withheld') }}
{{ __('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) }}
@endif {{-- Amount paid --------------------------------------------------- --}}
{{ __('Amount paid') }}
{{ $money($line_->net_pay) }}
{{ __('Method') }}
{{ $line_->payMethodLabel() }}
{{ __('Paid by') }}
{{ $companyName }}
@if ($line_->pay_method === 'bank' && $profile?->bank_account_number)
{{ __('Credited to') }}: {{ $profile->bank_name }} · {{ $profile->bank_account_name ?: $payeeName }} · {{ __('a/c') }} {{ $profile->bank_account_number }}
@elseif ($line_->pay_method === 'ecocash' && $profile?->mobile_money_number)
{{ __('Sent to') }}: {{ $profile->mobile_money_number }}
@endif @if ($line_->notes)
{{ __('Note') }}: {{ $line_->notes }}
@endif {{-- Stated once, plainly. The document already says what it is; a paragraph explaining the arrangement back to the person who agreed it would be talking down to them. --}}
{{ __('Paid as a consultancy fee for services rendered. No PAYE or NSSA is deducted.') }}
{{ __('Queries within 14 days of issue.') }}
{{ $companyName }} {{ __('Received by') }}
{{ __('Private & confidential') }}
{{ $companyName }} · {{ __('Payment advice for') }} {{ $period->format('F Y') }} {{ $line_->payslip_number ?: '' }}