Payslip

Employee #{{ $payslip->employee_id }} @if($payslip->employee) — {{ trim(($payslip->employee->first_name ?? '').' '.($payslip->employee->last_name ?? '')) }} @endif · Run {{ $payslip->payroll_run_id }} @if($payslip->payrollRun) · {{ $payslip->payrollRun->month }}/{{ $payslip->payrollRun->year }} @endif · {{ $payslip->currency_code }}

@php $grossSalary = (float) ($payslip->employeeSalary?->gross_salary ?? $payslip->gross_earnings); $grossEarnings = (float) $payslip->gross_earnings; $unpaidDeduction = max(0, $grossSalary - $grossEarnings); $structureDeductions = (float) $payslip->total_deductions; $totalDeductions = $unpaidDeduction + $structureDeductions; $snapshot = $payslip->attendanceSnapshot; $hasDeductions = $totalDeductions > 0.001 || !empty($payslip->deductions_breakdown); @endphp @foreach(($payslip->earnings_breakdown ?? []) as $code => $amount) @endforeach
EarningsAmount
{{ in_array(strtoupper((string) $code), ['OTHERS', 'OTHER'], true) ? 'Other Allowance' : ucwords(str_replace('_', ' ', (string) $code)) }}{{ number_format((float) $amount, 2) }}
Total earnings{{ number_format((float) $payslip->gross_earnings, 2) }}
@if($unpaidDeduction > 0.001) @php $absentDays = $snapshot ? (float) $snapshot->absent_days : 0; $unpaidLeave = $snapshot ? (float) $snapshot->unpaid_leave_days : 0; $absentNote = []; if ($absentDays > 0) { $absentNote[] = $absentDays.' day'.($absentDays > 1 ? 's' : '').' absent'; } if ($unpaidLeave > 0) { $absentNote[] = $unpaidLeave.' day'.($unpaidLeave > 1 ? 's' : '').' unpaid leave'; } @endphp @endif @foreach(($payslip->deductions_breakdown ?? []) as $code => $amount) @if((float) $amount > 0) @php $codeStr = (string) $code; $label = ucwords(str_replace('_', ' ', $codeStr)); $sub = null; if ($codeStr === 'fine' || $codeStr === 'late_fine') { $label = 'Late Fine'; if ($snapshot && (int) $snapshot->late_count > 0) { $sub = (int) $snapshot->late_count.' late arrival'.((int) $snapshot->late_count > 1 ? 's' : ''); } } elseif ($codeStr === 'income_tax') { $label = 'Income Tax'; } elseif ($codeStr === 'loan') { $label = 'Loan Installment'; } elseif ($codeStr === 'advance') { $label = 'Advance Deduction'; } elseif ($codeStr === 'pf') { $label = 'Provident Fund (PF)'; } @endphp @endif @endforeach @if(!$hasDeductions) @endif
DeductionsAmount
Absent Deduction @if(!empty($absentNote)) ({{ implode(', ', $absentNote) }}) @endif {{ number_format($unpaidDeduction, 2) }}
{{ $label }} @if($sub) ({{ $sub }}) @endif {{ number_format((float) $amount, 2) }}
No deductions recorded
Total deductions{{ number_format($totalDeductions, 2) }}
Gross Salary{{ number_format($grossSalary, 2) }}
Less: Total Deductions-{{ number_format($totalDeductions, 2) }}
Net Pay{{ number_format((float) $payslip->net_pay, 2) }}
Advance Already Paid{{ number_format((float) $payslip->advance_paid, 2) }}
Net Payable{{ number_format((float) $payslip->net_payable, 2) }}
@php $allocations = $payslip->paymentAllocations ?? collect(); $channelLabels = [ 'cash' => 'Cash', 'cheque' => 'Cheque', 'bank' => 'Bank', 'mobile_banking' => 'Mobile Banking', ]; @endphp @if($allocations->isNotEmpty())

Payment Breakdown

@foreach($allocations as $allocation) @php $channel = $allocation->channel instanceof \BackedEnum ? $allocation->channel->value : (string) $allocation->channel; @endphp @endforeach
ChannelAmount
{{ $channelLabels[$channel] ?? $channel }} {{ number_format((float) $allocation->amount, 2) }}
@endif