@php $companyId = auth()->user()->company_id; $fmt = fn ($n) => \App\Helpers\NumberHelper::formatAmount((float) $n, $companyId); $addressParts = array_filter([ $company->address ?? null, $company->city ?? null, $company->country ?? null, ]); $companyAddress = implode(', ', $addressParts); $employeeName = fn ($emp) => $emp->display_name ?: $emp->name; $joinDate = fn ($emp) => $emp->joining_date ? $emp->joining_date->format('d-m-Y') : '—'; @endphp Salary Pay Slip @foreach($slips as $slip) @php $emp = $slip['employee']; $maxRows = max(count($slip['earnings']), count($slip['deductions']), 1); $amountWords = \App\Helpers\NumberHelper::amountInWordsForCompany((float) $slip['net_salary'], $companyId); @endphp
{{ $company->name ?? 'Company' }}
@if($companyAddress)
{{ $companyAddress }}
@endif
SALARY PAY SLIP
{{ $slip['period_title'] }}
@if($company->hasLogo()) @endif
Employee Name:{{ $employeeName($emp) }}
Designation:{{ $emp->designation ?? '—' }}
Project:{{ $emp->project ?: 'HQ' }}
Date of Joining:{{ $joinDate($emp) }}
Employee ID:{{ $emp->code ?? '—' }}
Department:{{ $emp->department ?? '—' }}
Branch:{{ $emp->branch ?? '—' }}
Payment Method:{{ $emp->salary_payment_method ?? '—' }}
@for($i = 0; $i < $maxRows; $i++) @php $earning = $slip['earnings'][$i] ?? null; $deduction = $slip['deductions'][$i] ?? null; @endphp @endfor
EARNINGS DEDUCTIONS
Component AMOUNT Component AMOUNT
{{ $earning['label'] ?? '' }} {{ isset($earning) ? $fmt($earning['amount']) : '' }} {{ $deduction['label'] ?? '' }} {{ isset($deduction) ? $fmt($deduction['amount']) : '' }}
Total Earning {{ $fmt($slip['total_earnings']) }} Total Deduction {{ $fmt($slip['total_deductions']) }}
Net Salary Payable {{ $fmt($slip['net_salary']) }}
@if($slip['show_pf_note'])
Company also Provided {{ $fmt($slip['pf_company_amount']) }} to the Employees Contributory Provident Fund for this Salary Period
@endif
Net Amount in word: {{ $amountWords }}
PREPARED BY
CHECKED BY
APPROVED BY
This is a system-generated pay slip and does not require a physical signature.
@endforeach