{{ __('Payslip') }}: {{ $payroll->employee->name ?? '-' }} - {{ $payroll->period_display }}

@if($payroll->status === 'calculated')
@csrf
@endif Back to List
@if(session('success'))
{{ session('success') }}
@endif {{-- Payslip Card --}}
{{-- Header --}}

PAYSLIP

{{ $payroll->period_display }}

{{ ucfirst($payroll->status) }}
{{-- Employee Info --}}

Employee Details

Name:
{{ $payroll->employee->name ?? '-' }}
ID:
{{ $payroll->employee->employee_id ?? '-' }}
Type:
{{ $payroll->employee->employeeType->name ?? '-' }}

Bank Details

Bank:
{{ $payroll->employee->bank_name ?? '-' }}
Account:
{{ $payroll->employee->bank_account_number ?? '-' }}
{{-- Earnings --}}

EARNINGS

@if($payroll->personal_commission > 0) @endif @if($payroll->team_commission > 0) @endif @if($payroll->other_allowances > 0) @endif
Basic Salary RM {{ number_format($payroll->basic_salary, 2) }}
Personal Commission (Sales: RM {{ number_format($payroll->personal_sales, 0) }}) RM {{ number_format($payroll->personal_commission, 2) }}
Team Commission (Sales: RM {{ number_format($payroll->team_sales, 0) }}) RM {{ number_format($payroll->team_commission, 2) }}
Other Allowances RM {{ number_format($payroll->other_allowances, 2) }}
Gross Salary RM {{ number_format($payroll->gross_salary, 2) }}
{{-- Self-Funded Employer Statutory from Commission --}} @if($payroll->total_commission > 0) @php $selfFundedTotal = $payroll->epf_employer_commission + $payroll->socso_employer_commission + $payroll->eis_employer_commission; $commissionInPayslip = $payroll->total_commission - $selfFundedTotal; @endphp

SELF-FUNDED EMPLOYER STATUTORY (Deducted from Commission)

EPF Employer (self-funded) - RM {{ number_format($payroll->epf_employer_commission, 2) }}
SOCSO Employer (self-funded) - RM {{ number_format($payroll->socso_employer_commission, 2) }}
EIS Employer (self-funded) - RM {{ number_format($payroll->eis_employer_commission, 2) }}
Total Self-Funded - RM {{ number_format($selfFundedTotal, 2) }}
Commission in Payslip RM {{ number_format($commissionInPayslip, 2) }}

* All employer statutory (EPF + SOCSO + EIS) on commission is self-funded to keep company expenses fixed

@endif {{-- Employee Statutory Deductions --}} @php $totalEpfEe = $payroll->epf_employee_basic + $payroll->epf_employee_commission; $totalSocsoEe = $payroll->socso_employee_basic + $payroll->socso_employee_commission; $totalEisEe = $payroll->eis_employee_basic + $payroll->eis_employee_commission; $totalEe = $totalEpfEe + $totalSocsoEe + $totalEisEe; @endphp

EMPLOYEE STATUTORY DEDUCTIONS (on Total Wage)

@if($payroll->other_deductions > 0) @endif
EPF (11%) - RM {{ number_format($totalEpfEe, 2) }}
SOCSO - RM {{ number_format($totalSocsoEe, 2) }}
EIS - RM {{ number_format($totalEisEe, 2) }}
Other Deductions - RM {{ number_format($payroll->other_deductions, 2) }}
Total Employee Deductions - RM {{ number_format($totalEe + ($payroll->other_deductions ?? 0), 2) }}
{{-- Net Salary --}}
NET SALARY (Take Home) RM {{ number_format($payroll->net_salary, 2) }}
{{-- Company Expenses Summary --}} @php $companyExpenses = $payroll->basic_salary + $payroll->total_employer_contribution + $payroll->total_commission; @endphp

COMPANY EXPENSES

@if($payroll->total_commission > 0) @endif
Basic Salary RM {{ number_format($payroll->basic_salary, 2) }}
EPF Employer (Basic) RM {{ number_format($payroll->epf_employer_basic, 2) }}
SOCSO Employer (Basic) RM {{ number_format($payroll->socso_employer_basic, 2) }}
EIS Employer (Basic) RM {{ number_format($payroll->eis_employer_basic, 2) }}
Commission (Raw) RM {{ number_format($payroll->total_commission, 2) }}
TOTAL COMPANY EXPENSES RM {{ number_format($companyExpenses, 2) }}

* Commission statutory is self-funded by employee, not company expense

{{-- Footer --}}
Calculated: {{ $payroll->calculated_at?->format('d M Y H:i') ?? '-' }} @if($payroll->approved_at) Approved: {{ $payroll->approved_at->format('d M Y H:i') }} @endif @if($payroll->payment_date) Paid: {{ $payroll->payment_date->format('d M Y') }} @endif