HEBROTECH PAYROLL ONLINE - STANDALONE PHP/MYSQL BUILD

Deployment
1. Create a MySQL/MariaDB database in cPanel.
2. Import database/schema.sql using phpMyAdmin.
3. Edit config/config.php with the database credentials.
4. Upload the application files to the selected document root (recommended subdomain: payroll.yourdomain).
5. Create the first company and administrator. Passwords MUST be generated with PHP password_hash(), never stored as plain text.
6. Force HTTPS and protect config/backups from public access.

Implemented in this build
- Secure login foundation and company-scoped data access
- Dashboard
- Employee recruitment/register
- Activities master
- One-active-period workflow
- Timebook/attendance with role-dependent OPEN/COMPILED posting
- Advance calculation: earnings 1st-15th x 66%, nearest KSh 100
- Period payroll calculation foundation
- SHA, NSSF and AHL calculation placeholders according to established Hebrotech rules
- Payroll register/report printing
- Audit-ready database foundation

IMPORTANT
PAYE is deliberately NOT hard-coded in this build because statutory bands/reliefs are time-sensitive. Configure and validate the applicable KRA tax table before production payroll. Full P9/P9A, direct deposit instructions, labour allocation, termination/gratuity, leave, CSV imports, approvals/reopen workflow, email payslips and supervisor offline/mobile sync remain next-stage modules.


V3 statutory/reporting upgrade:
- Effective-dated SHA/SHIF, AHL, NSSF and OT settings.
- PAYE engine with KRA bands fallback: 24,000@10%; next 8,333@25%; next 467,667@30%; next 300,000@32.5%; balance@35%; personal relief 2,400.
- P9 history and payroll approval tables added to schema.
- Hebrotech NSSF default retained at KSh 200 employee / KSh 200 employer per approved project rule; editable by effective date.
- Before production use, confirm tax configuration against applicable law for the payroll period.


V4 REPORTING & CONTROLS
- Run database/v4_reporting_controls.sql after the existing schema/migrations.
- End-month reports: Payroll Summary, Payroll Register, bank-specific Direct Deposit Instruction, Labour Allocation, 4-per-A4 payslip print layout.
- Manager/Admin close and reopen approval workflow added.
- Period close locks payroll runs by setting them CLOSED.


V5 EMPLOYEE YEAR / FINAL PAY
Run database/v5_employee_year_finalpay.sql.
Adds P9 history view, statutory schedules, negative-net carry-forward records, termination/final pay with 22 gratuity days per completed year for Permanent employees, Banks/SACCO master, and CSV templates under templates/.


V6 HR & CONTROLS
Run database/v6_hr_controls.sql. Adds Personnel Review, transactional Employee CSV Import, Leave, Quick Control/Absentees/Reconciliation, salary/rate percentage reviews, audit entries and backend Email Configuration.


V7 PRODUCTION READINESS
Run database/v7_production.sql. Adds 15-minute idle session expiry, session ID rotation, CSRF helper foundation, correction queue, attendance/piecework CSV import, Bank/SACCO import, automated leave balances, backpay review estimates, and payslip attendance calendar. SMTP secrets remain server-side/protected.


V8 INSTALLATION & DEPLOYMENT
Adds first-run installer, forced first-login password change, password reset token workflow, system checks, company-scoped backup export, config example and CPANEL_DEPLOYMENT.txt. Remove install.php after first setup.
