@php $oldRows = collect(old('payslips', [])); $initialRows = $staff->values()->map(function ($employee, $index) use ($oldRows) { $old = $oldRows->first(fn ($row) => (string) ($row['user_id'] ?? '') === (string) $employee->id) ?? []; return [ 'key' => $index, 'user_id' => $employee->id, 'name' => $employee->name, 'employee_no' => $employee->employee_no, 'designation' => $employee->designation, 'department' => $employee->department?->name, 'basic_salary' => (string) ($old['basic_salary'] ?? ''), 'allowances' => (string) ($old['allowances'] ?? ''), 'overtime_amount' => (string) ($old['overtime_amount'] ?? ''), 'loan_deduction' => (string) ($old['loan_deduction'] ?? ''), 'other_deductions' => (string) ($old['other_deductions'] ?? ''), ]; })->values(); $months = collect(range(1, 12))->mapWithKeys(fn ($m) => [$m => date('F', mktime(0, 0, 0, $m, 1))]); $yearOptions = collect(range(now()->year, now()->year - 3))->mapWithKeys(fn ($y) => [$y => (string) $y]); @endphp @if ($errors->any())

Please fix the following before processing:

    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf

Payroll period

One run per calendar month — opening an existing month replaces this form.

Payslips

Only staff with a basic salary or allowance are included in the run.

@if ($staff->isEmpty()) @else
Staff member Basic salary Allowances Overtime Loan deduction Other deductions Gross (computed)
Totals — staff member(s) with pay Gross

PAYE, SHIF, NSSF and the Housing Levy are calculated on the gross pay of each staff member when the run is processed. Approval posts the salary accrual journal; paying out posts the bank payout journal and settles the payslips.

@endif
Cancel