HR and payroll system: attendance, leave, the payroll run and wage protection
A web system for a mid-sized contracting company in Riyadh with 84 employees. It moves HR off Excel files, paper leave requests and a payroll worked out by hand every month, onto a payroll run that is reviewed, approved and exported as a Wage Protection System file, with expiry alerts on employee documents and an end-of-service calculator.
Interactive prototype: 10 web screens: employees, attendance, approvals, the payroll run, wage protection, GOSI and end of service.
Open the prototype1Executive summary
The company employs 84 people, 52 Saudi and 32 non-Saudi, across the head office and three sites. Attendance sits on a fingerprint terminal whose records are exported by hand, leave requests are on paper, payroll is worked out in an Excel file every month and takes three days, the wage protection file is built manually, and iqamas and contracts expire with no advance warning.
This document specifies a web system covering employee master data and documents, attendance and leave, approval workflow, the payroll run and its approval, the wage protection file, GOSI contributions and the end-of-service award. The initial estimate is 700–960 development hours, that is 12–16 weeks for a team of two developers.
2Current state and objectives
| Problem today | Impact | Objective in release 1 |
|---|---|---|
| Payroll is run in Excel | Three working days a month, and errors that are hard to trace | A payroll run calculated by the system, then reviewed and approved in recorded steps |
| The wage protection file is built by hand | Risk of missing the deadline, and violations | The file exported straight from the approved payroll run |
| Leave requests are on paper | Inaccurate balances and disputes | An electronic request with a calculated balance and an approval workflow |
| Attendance is exported from the fingerprint terminal by hand | Late and unexplained deductions | A daily import feeding the payroll run directly |
| No alert before iqamas and contracts expire | Violations and work stopping without warning | Alerts at 60, 30 and 7 days before expiry |
Headcount and its split come from the discovery session, and are to be confirmed before sign-off.
3Users and roles
| Role | What they do | What they cannot see |
|---|---|---|
| Employee | Sees their own leave balance and payslip, and files their own requests | Cannot see colleagues' records |
| Line manager | Approves their team's leave and sees their attendance | Cannot see their pay |
| HR specialist | Maintains employee master data, documents, attendance and leave, and prepares the payroll run | Cannot give the payroll run its final approval |
| Finance manager | Reviews and approves the payroll run, and exports the wage protection file | — |
| General manager | Approves exceptions, pay increases and reports | — |
4Release 1 scope (MoSCoW)
MustRequired to launch
- Employee master data: contract, pay and its components, documents and their expiry dates
- Expiry alerts for the iqama, the contract and certificates
- Attendance: import from the fingerprint terminal, plus lateness, absence and overtime
- Leave: entitlement and balances, requests and the approval workflow
- Payroll run: calculation, review, approval and lock
- A payslip for every employee
- A wage protection file ready to file
- GOSI contributions on rates that can be updated
- End-of-service award calculator
- Role-based permissions and an audit trail
- Reports: labour cost, absence, leave and turnover
ShouldValuable, not a launch condition
- Employee self-service portal on mobile
- Salary advance requests and their recovery by instalments
- Electronic signature on contracts and letters
- Export of the payroll journal to the accounting system
- English interface
CouldIf time allows
- Periodic performance appraisal
- Training plans and certificates
- Geolocated attendance for site staff
Won'tNot in release 1
- Recruitment and applicant tracking
- General accounting
- Custody and asset management
- Multi-currency payroll
5Functional requirements
Story format: "As a… I want… so that…". Acceptance criteria use Given / When / Then.
Employees and documents EMP
As an HR specialist, I want one record per employee holding the contract, the pay and the documents, so that I stop hunting through folders.
MustAs an HR specialist, I want an alert before any document expires, so that site work does not stop because of an expired iqama.
MustGiven a document expiring within 60 days, then an alert appears on the HR dashboard and repeats at 30 and 7 days, and the system records who acknowledged it.
Attendance and leave ATT
As an HR specialist, I want attendance imported daily from the fingerprint terminal, so that lateness, absence and overtime are calculated without keying.
MustGiven a full working day, when an employee clocks in more than 15 minutes after the shift starts, then the system counts it as lateness and it appears in the month's report (BR-02).
As an employee, I want to see my leave balance and file a request, so that I know my entitlement before I ask.
MustGiven my balance is not enough, then the system blocks submission and shows the available balance and the date the next accrual falls due.
As a line manager, I want to approve or reject my team's requests with a reason, so that the decisions stay on record.
MustWhen I approve the request, then the balance is reserved at once, the approval passes to HR, and the employee is notified of the outcome.
Payroll PAY
As an HR specialist, I want the month's payroll run generated from contracts, attendance and requests, so that I stop building a new Excel file every month.
MustWhen I generate the run, then the system calculates for each employee: basic pay and allowances, overtime, deductions for lateness, absence and advances, and the employee GOSI contribution, and shows the variance against the previous month for review.
As a finance manager, I want to approve the payroll run and lock it, so that it cannot change after payment.
MustWhen I approve the run, then the system locks it and accepts no edit, and any later correction is an adjustment in the following month's run carrying its reason (BR-05).
As a finance manager, I want to export the wage protection file from the approved payroll run, so that I file it on time without re-keying.
MustGiven an approved run, then the file is generated with every employee's details, amounts and payment channels, and the system shows the time left to pay (BR-06).
As an employee, I want my monthly payslip, so that I understand my earnings and my deductions.
MustGOSI and end of service GOV
As a finance manager, I want GOSI contributions calculated on rates that can be updated, so that the system stays correct when the regulations change.
MustGiven a Saudi employee, then the contribution is calculated on the subject wage (basic plus housing) at the employee and employer rates held in settings, subject to a ceiling on the subject wage. And given a non-Saudi employee, then the contribution is employer-only at the occupational hazards rate (BR-07).
As an HR specialist, I want the end-of-service award calculated by reason for leaving, so that the final settlement is paid without dispute.
MustGiven termination by the employer, then the award is half a month for each of the first five years and one month for each year after that, pro-rated for part years. And given a resignation, then the system applies the entitlement fractions for the length of service (BR-08).
As a general manager, I want labour cost, absence and turnover reports, so that I decide on the numbers.
Must6Business rules
| Id | Rule |
|---|---|
| BR-01 | Annual leave entitlement accrues pro rata each month, and the employee sees an available balance and a balance reserved by requests not yet taken. |
| BR-02 | Lateness is counted from 15 minutes after the shift starts, and three occurrences in a month equal one day's deduction, unless the manager approves a recorded exception. |
| BR-03 | Overtime hours are approved by the line manager before they enter the payroll run. |
| BR-04 | A salary advance does not exceed one month's pay, and is recovered in instalments of no more than 25% of monthly net pay. |
| BR-05 | Once approved, a payroll run is locked; any correction is an adjustment in the following month carrying a recorded reason. |
| BR-06 | The wage protection file is exported only from an approved payroll run, and the system flags the statutory deadline for payment after the end of the pay period. |
| BR-07 | GOSI rates and the ceiling on the subject wage are held in system settings, not in code, and the date of every change is recorded. |
| BR-08 | The end-of-service award is calculated on final wage: half a month for each of the first five years and one month for each year after that, pro-rated for part years, with the entitlement fractions applied in the case of resignation. |
| BR-09 | An employee's pay is changed only by a decision approved by the general manager, filed in the employee record with its effective date. |
The lateness and advance rules are internal and proposed here, for company management to adopt. The statutory rules are for the labour adviser to review before launch.
7Data model and payroll run lifecycle
The payroll run is the central entity of every month: it pulls contracts, attendance and requests into a single picture that is reviewed, approved and locked, and the wage protection file and the payslips are built on it.
| Entity | Key fields | Relationships |
|---|---|---|
| Employee | Name, nationality, national ID or iqama, hire date, department, line manager, bank account | Has a contract, documents, requests and attendance records |
| Contract | Type, term, basic pay, allowances, working hours, effective date | Belongs to an employee, and keeps dated versions |
| Document | Type, number, expiry date, attachment, alert status | Belongs to an employee |
| Attendance record | Date, clock-in, clock-out, lateness, overtime, source of the record | Belongs to an employee |
| Request | Type (leave / advance / resignation), duration or amount, approval status, reason | Has an approval workflow |
| Payroll run | Month, state (draft / under review / approved / posted), total, who approved it and when | Has one line per employee |
| Payroll line | Pay, allowances, overtime, deductions, employee GOSI contribution, net | Belongs to a run and an employee |
| Wage protection file | Month, headcount, total, generation date, filing status | Belongs to an approved run |
| Audit trail | User, action, value before and after, reason, time | Not editable |
Monthly payroll run lifecycle
8Non-functional requirements and compliance
| Id | Area | Requirement |
|---|---|---|
| NFR-01 | Financial accuracy | Every amount carries two decimal places, and re-generating the payroll run from the same inputs gives the same result. |
| NFR-02 | Performance | A payroll run for 84 employees generates in under 30 seconds, and an employee record opens in under a second. |
| NFR-03 | Confidentiality | Pay data is shown only to users who hold the permission, and does not appear in shared reports. |
| NFR-04 | Personal data protection | Employee data and documents are processed with consent and notice, retained only for the statutory period, with a breach notification procedure within 72 hours. |
| NFR-05 | Auditability | Every change to pay, deductions or approvals leaves a trace carrying the user, the reason and the time. |
| NFR-06 | Hosting and backup | A data centre inside the Kingdom, and a daily backup whose restore is tested monthly. |
| NFR-07 | Language | Arabic right-to-left first, Gregorian dates, with the Hijri date shown on letters. |
9Integrations
| Integration | Purpose | Priority | Notes |
|---|---|---|---|
| Wage Protection System (WPS) file, filed through Mudad | Filing the monthly payroll return | Must | In release 1: export the file in the required format and file it through the platform. A machine interface is an open question. |
| Fingerprint terminal | Daily import of attendance records | Must | Through an export file or the device interface, depending on the model installed. |
| Bank | Salary transfer file | Must | In the format of the company's bank. |
| GOSI | Monthly reconciliation of contributions | Should | Manual reconciliation in release 1. |
| Email and SMS | Request notifications and payslips | Must | — |
| Accounting system | Export of the payroll journal | Should | An export file in release 1. |
The Wage Protection System (WPS) monitors the payment of private-sector wages. It covers every registered establishment, whatever its size, and a monthly return is filed carrying every employee's details, amounts and payment channels. The source consulted states that payment must be made within 10 days of the end of the pay period, and that being late is recorded as a violation.
As published for 2026: Saudis registered before 3 Jul 2024 carry a combined rate of 21.5% (employer 11.75%, employee 9.75%); those registered after that date fall under stepped higher rates that are updated each year; non-Saudi residents carry 2% on the employer only (occupational hazards). The ceiling on the subject wage is SAR 45,000 (basic plus housing). This is why the rates are held in settings (BR-07) and reviewed annually.
Half a month for each of the first five years, one month for each year after that, pro-rated for part years, calculated on final wage. On resignation: no entitlement under two years, one third of the award from two years to five, and two thirds from five to ten.
10Out of scope
- Recruitment and applicant tracking.
- General accounting and the financial statements.
- Custody and asset management.
- Multi-currency payroll, and payroll for branches outside the Kingdom.
- Medical insurance and the administration of its policies.
11Delivery plan and effort estimate
| Module | Phase | Hours (low – high) |
|---|---|---|
| Design and screens, built out from the prototype | 1 | 45 – 60 |
| Users, permissions and the audit trail | 1 | 40 – 55 |
| Employee records, contracts, documents and alerts | 1 | 70 – 95 |
| Attendance and the fingerprint terminal import | 1–2 | 65 – 90 |
| Leave, balances and approvals | 2 | 70 – 95 |
| Payroll calculation engine | 2 | 110 – 150 |
| Payslips and the bank transfer file | 2 | 45 – 60 |
| Wage protection file | 2–3 | 50 – 70 |
| GOSI and end of service | 3 | 55 – 75 |
| Reports | 3 | 35 – 50 |
| Testing and QA | 1–3 | 90 – 120 |
| Migration from Excel, training and go-live | 3 | 25 – 40 |
| Total | 700 – 960 |
| Phase | Weeks | Outcome |
|---|---|---|
| 1 · Foundation | 1–5 | Employees, contracts, documents and attendance. |
| 2 · Payroll | 6–11 | Leave, approvals, calculation, payslips and the bank transfer file. |
| 3 · Compliance | 12–16 | Wage protection, GOSI, end of service, reports and migration. |
The estimate covers Must requirements only, for a team of two developers with a part-time tester. It excludes cleaning the Excel data before migration and the purchase of new fingerprint terminals.
12Risks and open questions
| Item | Type | Proposed action |
|---|---|---|
| Is a machine interface available for filing the wage protection file? | Open question | Ask the service provider early; the fallback is an exported file filed by hand. |
| Fingerprint terminal model, and whether it can export automatically | Open question | A technical survey in phase 1 before the import method is fixed. |
| GOSI rates for those registered after Jul 2024 change every year | Risk | Rates in settings with an effective date, and a scheduled annual review. |
| Accuracy of the leave balances migrated from Excel | Risk | A balance reconciliation signed by each employee before migration. |
| Reading of the Labour Law clauses in edge cases | Open question | Labour adviser review of the resignation and termination rules before launch. |