# HR and Payroll Upgrade

## Payroll workflow

1. Open Human Resource > Employees. Enter salary, allowances, employee number,
   statutory registration numbers and payment information.
2. Open Payroll > Generate Payroll. Select the branch and all or selected staff.
3. Select a complete calendar month and a pay date in that month for automatic
   Kenyan monthly calculations. Choose Resident or Non-resident according to the
   employees' actual tax residence. Process different groups separately.
4. Review the draft. Additional payments recalculate automatic deductions.
   Advances, loans, SACCO/HELB and other deductions remain editable.
5. Finalise only after checking the figures. Finalised is not proof of payment.
   Existing payroll payment/accounting workflows have not been replaced.
6. Print/download payslips; review P9 tax details before annual P9 download.

## Automatic calculation scope

- February 2026 through January 2027; unsupported periods require manual review.
- Monthly PAYE bands: 10%, 25%, 30%, 32.5%, 35%.
- Resident personal relief: KES 2,400/month; non-residents receive no personal relief.
- NSSF Year 4: employee 6%, lower earnings limit 9,000, upper limit 108,000;
  employer match recorded separately in the calculation snapshot.
- SHIF: 2.75% of gross, minimum 300.
- Employee and employer Housing Levy: 1.5% of gross each.
- Employee NSSF, SHIF and Housing Levy reduce taxable pay before PAYE.
- Employer contributions are not deducted from employee net pay.
- These standard cash-salary calculations do not handle disability exemptions,
  non-cash benefits, contracted-out pension schemes, insurance relief, extra
  pension/mortgage deductions, arrears or partial-month proration. Use Manual
  Review for those cases, with accountant-approved figures and P9 review.
- Active custom components continue to apply to all selected employees, as in
  the existing setup. Use draft entry edits for employee-specific deductions.
  Automatic mode excludes configured PAYE/NSSF/SHIF/Housing Levy deduction
  components to prevent double charging. Never create those as earnings.
- Tax cards are not automatically marked reviewed; payroll identity and P9
  validation remain in place.

## Controls and reports

- Overlapping payroll periods for an employee are blocked across branches.
- Finalising payroll closes its calendar month(s) for that employee. Changing
  dates within the same month cannot bypass the lock. Other employees not yet
  processed can still receive their payroll; subsequent months remain available.
- Draft updates and finalisation lock the run to avoid simultaneous changes.
- Deductions greater than gross pay are rejected, not silently clamped to zero.
- Employee, branch, pay-date and status filters also apply to CSV exports.
- CSV includes totals and available employer contribution snapshots. Blank
  employer amounts on older/manual entries mean uncalculated, not an exemption.
- Payroll components can be edited or deactivated by Payroll Setup permission.
  These changes do not recalculate previously generated payrolls.
- Overlapping pending/approved leave applications are blocked. Leave approvals
  are also checked for overlap; existing calendar-day leave counting is unchanged.

## Deployment

Copy the updated files and back up the destination database, then run:

```text
php artisan migrate --force
php artisan view:clear
```

Migration `2026_10_10_190000_add_payroll_calculation_snapshot` adds the run's
statutory mode and entry calculation snapshot. Old runs default to Manual Review;
existing amounts, employees and payslips are not recalculated.

## Reference documentation

- https://docs.frappe.io/hr/payroll-entry
- https://docs.frappe.io/hr/human-resources-reports
- https://www.kra.go.ke/individual/filing-paying/types-of-taxes/paye
- https://www.nssf.or.ke/notice-to-employers-year-4-2026-nssf-contribution-rates
- https://communityhub.sage.com/za/sage-payroll-professional/f/announcements/262814/kenya-national-social-security-fund-nssf-contributions-limits-increase-effective-1-february-2026
- https://www.sha.go.ke/premium-rates/

Public product documentation informed the workflow. This upgrade does not copy
private HR installations and does not add recruitment or training management.
