Incentive
The incentive module calculates a monthly incentive for each worker, automatically.
It rewards workers who produce more, make few defects, come to work, and work on a line that hits its target.
Types of Incentive
Section titled “Types of Incentive”A worker can earn two kinds of incentive each month. They are calculated separately and then added together.
1. Monthly Incentive (the main part)
Section titled “1. Monthly Incentive (the main part)”Rewards output and good performance.
How it is calculated:
Monthly Incentive = earned minutes × rate of the Operation Category| Operation Category | Rate per earned minute |
|---|---|
| Critical | Rs. 1.00 |
| Standard | Rs. 0.50 |
| Helping | Rs. 0.10 |
Example: a worker on Critical operations who earned 10,000 minutes → Rs. 10,000, before any reductions. There is no maximum.
What reduces it (with the default settings):
| Reason | Effect |
|---|---|
| One of the line’s two targets (efficiency or DHU) missed | Deduct 50% |
| Missed 4 days | Deduct 50% |
| Missed 5 days | Deduct 75% |
| 25 – 50 rejected pieces (2nds) | Deduct 25% |
| 51 – 75 rejected pieces (2nds) | Deduct 50% |
| Overtime amount | Subtracted |
Who is eligible: only workers present 15 or more days on one line in the month (adjustable in the settings). With the default settings, other workers get an incentive of Rs. 0 but are still listed, and still get the attendance bonus. Disabled workers and workers not present on any day of the month are not listed.
What cancels it (becomes Rs. 0), with the default settings:
- The worker’s efficiency or DHU missed its target
- Both line targets (efficiency and DHU) missed
- Missed 6 or more days (default attendance band: deduct 100%)
- 76 or more rejected pieces (2nds) (default band: deduct 100%)
- The overtime amount is equal to or more than the incentive
Every deduction % above, and the days absent and rejected pieces cutoffs, come from the settings, so an admin can change them.
2. Attendance Bonus
Section titled “2. Attendance Bonus”Rewards coming to work every day of the worker’s shift. It does not depend on output, defects, targets, or 2nds.
How it is calculated: a fixed amount for the worker’s shift, based on days absent:
| Days absent | Night shift (Rs.) | Morning shift (Rs.) |
|---|---|---|
| 0 | 2,500 | 1,500 |
| 1 | 1,500 | 500 |
| 2 | 1,000 | 0 |
The amounts above are an example. The real amounts come from the incentive settings: one default list of amounts for every shift, which a shift can override with its own list.
What stops it: with the example amounts above, missing 3 or more days. The cutoff comes from the steps set for each shift in the settings.
It is paid even when the Monthly Incentive is 0.
Before override = Monthly Incentive + Attendance BonusA user with access to the incentive screens can replace the net payable of a worker for one month by hand (a reason can be added), for example in a special month.
| Term | Meaning |
|---|---|
| Operation Category | How critical an operation is: Critical, Standard (machine work, pressing), or Helping. Sets the incentive rate. |
| Earned minutes | Pieces made × standard minutes of the operation. The amount of “standard work” a worker did. |
| Efficiency % | Earned minutes ÷ time available to work × 100. How fast a worker works compared to the standard. |
| DHU % | Defects per Hundred Units: defects found per 100 pieces checked. Lower is better. |
| Rejected piece (2nd) | A piece rejected at the end-line quality check. |
| Present day | A day the worker logged into at least one station. |
| Days absent | Scheduled days in the month − days present. Holidays set in the Day Off module are not scheduled days. |
| Incentive month | From the month start day to the day before it in the next month. With start day 3, September is 3 September to 2 October. With start day 1, it is the calendar month. |
Where the Data Comes From
Section titled “Where the Data Comes From”- Computed figures (attendance, efficiency, DHU, rejections) → reporting database, only its
reporting_dwdatasets. - Master data and settings (operations, Operation Category, shifts, targets) → main database.
The reporting database also has copies of some main tables (Cutting, Essentials, Planning). These are never used and will be removed.
| What | Source |
|---|---|
| Days present, days on each line, scheduled days | reporting_dw.eff_availability_worker_daily |
| Earned minutes per operation | reporting_dw.eff_efficiency_worker_operation_daily |
| Worker efficiency, worker pieces | reporting_dw.eff_efficiency_worker_daily |
| Worker defects | reporting_dw.qc_fault_operator_operation_daily |
| Line efficiency | reporting_dw.eff_efficiency_line_workorder_daily |
| Line efficiency target | Main database: Incentive.LineTarget (Line Target screen) |
| Line DHU | reporting_dw.qc_endline_dhu_daily |
| 2nds (rejected pieces per worker) | reporting_dw.qc_endline_defects |
| Operation Category of each operation | Main database: Essentials.Operation.OperationCategory |
| Attendance bonus amounts | Incentive settings (Config.Config) |
| Line DHU target | Incentive settings (Config.Config) |
| Posted month (with overrides) | Main database: Incentive.WorkerIncentiveMonth and Incentive.WorkerIncentive |
The Calculation
Section titled “The Calculation”Once per worker per month, in this order. It is calculated live each time the screen is opened. The deductions shown are the defaults; each one is a setting.
1. Earned Minutes × Rate
Section titled “1. Earned Minutes × Rate”| Operation Category | Rate / minute (Rs.) |
|---|---|
| Critical | 1.00 |
| Standard | 0.50 |
| Helping | 0.10 |
Incentive = Σ (earned minutes on each operation × rate of that operation's Operation Category)The more a worker produces, the more they earn. A worker who works on operations of different categories is paid each operation at its own category’s rate.
| Data | Read from | Stored in |
|---|---|---|
| Earned minutes per operation | reporting_dw.eff_efficiency_worker_operation_daily | Not stored |
| Operation Category | Main database | Essentials.Operation.OperationCategory (new column) |
| Rate per minute | Incentive settings | Config.Config → Incentive value |
2. 15 Days on One Line
Section titled “2. 15 Days on One Line”The worker’s line is the one where they were present 15 or more days (adjustable in the settings, Minimum Days on One Line).
If no line reaches 15 days, the worker is not eligible: the Deduction % Below Minimum Days setting is deducted (default 100%, so the incentive is Rs. 0), but the worker is still listed and still gets the attendance bonus. Its net payable can still be overridden.
A worker is listed once, under the line where they were present the most days. If two lines have the same number of days, the line with the lower line ID is used.
| Data | Read from | Stored in |
|---|---|---|
| Days present on each line | reporting_dw.eff_availability_worker_daily (rows with IsAbsent = 0, per LineID) | Not stored |
| 15 days | Incentive settings | Config.Config → Incentive value |
3. Line Targets
Section titled “3. Line Targets”The worker’s line (from step 2) is checked against its Efficiency % and DHU % targets:
| Line result | Deduction (default) | Setting |
|---|---|---|
| Both targets met | 0% | |
| One target missed | 50% | Deduction % When One Target Is Missed |
| Both targets missed | 100% | Deduction % When Both Targets Are Missed |
Line efficiency % = Σ earned minutes ÷ Σ available minutes × 100 earned minutes = garment SAM × finished pieces (passed end-line QC) available minutes = workers logged in × shift minutes
Line efficiency target = Σ (daily target × planned workers × shift hours) ÷ Σ (planned workers × shift hours)
Line DHU % = Σ end-line defects ÷ Σ pieces checked × 100 (production sections)- Everything is added up over the whole month, then divided once.
- The month target is a weighted average of the line’s daily targets on the Line Target screen: days with more planned workers count more.
- If the line has no target on the Line Target screen that month, the efficiency check is skipped.
Meeting a target (steps 3 and 4): efficiency at or above, DHU at or below. Missing data = not met. Every efficiency and DHU %, and the line efficiency target, is rounded to 2 decimal places before it is compared.
The line efficiency target can be typed as a percent (65) or a fraction (0.65) on the Line Target screen. A value above 1 is used as a percent, and a value of 1 or less is multiplied by 100, so both work.
| Data | Read from | Stored in |
|---|---|---|
| Line efficiency | reporting_dw.eff_efficiency_line_workorder_daily | Not stored |
| Line efficiency target | Main database: Incentive.LineTarget | Entered on the existing Line Target screen |
| Line DHU | reporting_dw.qc_endline_dhu_daily | Not stored |
| Line DHU target | Incentive settings | Config.Config → Incentive value (new setting) |
4. Worker Targets
Section titled “4. Worker Targets”The worker’s Efficiency % and DHU % must both meet their targets. If either misses, the Deduction % When a Target Is Missed setting is deducted (default 100%, so the incentive is 0).
Worker efficiency % = Σ earned minutes ÷ Σ workable minutes × 100 (workable = shift time − breaks; days the worker was absent are left out)Worker DHU % = Σ worker's defects ÷ Σ pieces the worker produced × 100Worker DHU counts all pieces the worker sewed, not only the pieces checked at end-line.
| Data | Read from | Stored in |
|---|---|---|
| Earned minutes, workable minutes | reporting_dw.eff_efficiency_worker_daily (AttendanceStatus: absent days are left out) | Not stored |
| Worker defects | reporting_dw.qc_fault_operator_operation_daily (OperationFaults) | Not stored |
| Worker pieces | reporting_dw.eff_efficiency_worker_daily (PiecesProduced) | Not stored |
| Worker efficiency and DHU targets | Incentive Settings screen (one general value each) | Config.Config → Incentive value |
5. Attendance Deduction
Section titled “5. Attendance Deduction”Based on days absent, so it works for any month length. Holidays from the Day Off module are already left out of scheduled days.
The table shows the default bands. The real cutoffs come from the attendance bands in the settings.
| Days absent | Deducted | Same as in a 26-day month |
|---|---|---|
| 0 – 3 | 0% | 23 or more days present |
| 4 | 50% | 22 days present |
| 5 | 75% | 21 days present |
| 6 or more | 100% | 20 or fewer days present |
| Data | Read from | Stored in |
|---|---|---|
| Scheduled days, days present | reporting_dw.eff_availability_worker_daily (scheduled shift-days; rows with IsAbsent = 0 are present) | Not stored |
| Attendance bands | Incentive settings | Config.Config → Incentive value |
6. Quality Deduction (Rejected Pieces)
Section titled “6. Quality Deduction (Rejected Pieces)”The table shows the default bands. The real cutoffs come from the rejected pieces bands in the settings.
| 2nds in the month | Deducted |
|---|---|
| 0 – 24 | 0% |
| 25 – 50 | 25% |
| 51 – 75 | 50% |
| 76 or more | 100% |
- A 2nd = a piece rejected at the end-line quality check.
- Every worker blamed for a fault on that piece gets one 2nd. A fault with no worker counts against no one.
- It counts in the month of the rejection.
| Data | Read from | Stored in |
|---|---|---|
| Rejected pieces and the blamed worker | reporting_dw.qc_endline_defects (Rejected = 1, WorkerID) | Not stored |
| 2nds bands | Incentive settings | Config.Config → Incentive value |
7. Overtime
Section titled “7. Overtime”The overtime amount is subtracted from the incentive (client document, Clause 4.11):
Overtime amount = Σ (overtime minutes on each day × overtime rate of that day's Operation Category)Incentive = Incentive − Overtime amount (never below 0)- If the overtime amount is more than the incentive → no incentive is paid.
- If it is less → the incentive minus the overtime is paid. Example: Rs. 15,000 − Rs. 12,480 = Rs. 2,520.
- A day’s Operation Category is the category the worker earned the most minutes in that day. A day with overtime but no earned minutes uses Standard.
- With an overtime rate of 0 for a category (the default), overtime in that category is not subtracted.
- Only overtime inside the shift’s allowed late-out time is counted, so no approval step is needed.
| Data | Read from | Stored in |
|---|---|---|
| Overtime minutes per day | reporting_dw.eff_availability_worker_daily (OvertimeMinutes: minutes logged in after the shift ended, inside the allowed late-out time) | Not stored |
| Earned minutes per day, per operation | reporting_dw.eff_efficiency_worker_operation_daily | Not stored |
| Overtime rate per category | Incentive settings | Config.Config → Incentive value (new setting) |
8. Attendance Bonus
Section titled “8. Attendance Bonus”Added on top, even when the incentive is 0. The amounts are set in the incentive settings as a list of steps (days absent from → amount): one default list for every shift, and an optional override list per shift. Example of a night shift override and a morning shift that uses the default:
| Days absent | Night shift (Rs.) | Morning shift (Rs.) |
|---|---|---|
| 0 | 2,500 | 1,500 |
| 1 | 1,500 | 500 |
| 2 | 1,000 | 0 |
| 3 or more | 0 | 0 |
- The worker’s shift is the shift they were scheduled on for the most days in the month. Workers normally keep one shift all month. In the rare case of a change, the shift where they spent more days is used, and the shift with the lower shift ID wins a tie.
- A step applies from its days absent up to the next step. A last step with amount 0 (for example 3 days absent → 0) stops the bonus.
- A shift with an override uses its own list instead of the default list. The two lists are not mixed. A shift with no override uses the default list (default: 0 days absent → Rs. 1,500, 1 → Rs. 500, 2 or more → 0).
| Data | Read from | Stored in |
|---|---|---|
| Worker’s shift, days absent | reporting_dw.eff_availability_worker_daily (ShiftID) | Not stored |
| Attendance bonus amounts | Incentive settings | Config.Config → Incentive value (new setting: default steps, and steps per shift override) |
Net Payable
Section titled “Net Payable”Before override = (Base × (100% − Line days deduction) × (100% − Line deduction) × (100% − Worker targets deduction) × (100% − Attendance deduction) × (100% − Quality deduction) − Overtime amount, never below 0) + Attendance bonusNet payable = override amount if one is set, otherwise before override- With the default settings, the incentive part is 0 when the worker is below the minimum days on one line (step 2) or misses a worker target (step 4).
- The amount before override is rounded to the nearest rupee, so it is a whole number of rupees like an override. The other amounts are calculated unrounded and shown rounded to the nearest rupee. Each money column is rounded on its own, and a line total adds the rounded values.
- Every worker present on at least one day of the month is listed (see Screen), with the full breakdown, even when the result is 0.
- Override: before the month is posted, a user with access to the incentive screens can replace the net payable (incentive + attendance bonus) of any worker. The amount is a whole number of rupees. A reason can be added but is optional. The overridden amount is what gets paid. The screen shows the amount before override beside it, and removing the override goes back to the calculated amount. Overrides are kept on the screen only until the month is posted; changing the month or reloading the page drops them.
- Post: posting a finished month saves the settings it was calculated with, and for every listed worker the figures the calculation starts from (days, earned and overtime minutes per category, efficiency and DHU, line results, rejected pieces, shift), the amount before override and the override. From then on the month is calculated again from the saved rows with the saved settings, not from the
reporting_dwdatasets, so later data or settings changes do not move it. The amount before override is saved as calculated at posting, so a later change to the formula does not move what was paid either. A posted month cannot be edited; Delete removes it, and the month is calculated again from the datasets.
| Data | Read from | Stored in |
|---|---|---|
| Posted month | Calculated, with user’s overrides | Incentive.WorkerIncentiveMonth: one row per month, with the settings used and who posted it. The month is stored as the 1st of that month, so it still matches if the month start day setting changes. Incentive.WorkerIncentive: one row per worker per month, with the calculation’s inputs, CalculatedAmount (before override), OverrideAmount and OverrideReason |
Operation Category
Section titled “Operation Category”Each operation has one Operation Category, saved on the operation in the main database. It is filled automatically once, then admins fix the exceptions:
| Rule | Category |
|---|---|
Marked critical (IsCritical) in a layout | Critical |
| Otherwise a machine operation | Standard |
| Otherwise (manual) | Helping |
Pressing is manual but belongs in Standard, so it is fixed by hand.
The categories are a fixed list: Critical, Standard and Helping. They are stored by name in Essentials.Operation.OperationCategory, and a check constraint allows only these three. Adding a category is a code and database change. A new operation gets Standard by default until an admin changes it, and earned minutes on an operation missing from the main database are paid at the Standard rate. Standard is also used for an overtime day with no earned minutes.
The category is chosen on the Operation screen (add, edit, and import), and shown in the operation list and details. Operations sent through the integration API get Standard.
Settings
Section titled “Settings”Set on the Incentive Settings screen, opened from the Settings button on the Worker Incentive screen. Stored as one Incentive value in the existing Config.Config table (ConfigType = 'Incentive'). No new table.
- Rate per minute and overtime rate per minute, per Operation Category (overtime default 0 = not subtracted)
- Attendance bonus: a default list of steps (days absent from → amount) used by every shift, and an optional override list per shift that replaces it
- Worker efficiency target and worker DHU target (one general value each), and the deduction % when either is missed (default 100)
- Line DHU target: the highest line DHU allowed (default 5). A blank value skips the line DHU check.
- Deduction % when one (default 50) or both (default 100) line targets are missed
- Month start day (1 to 28, default 1). Only up to 28, so every month has that day.
- Minimum days on a line (15), and the deduction % below it (default 100)
- Attendance bands and 2nds bands: for each row, the days absent (or rejected pieces) it starts from and the deduction % (0 to 100)
If the worker efficiency or worker DHU target has not been set, that check is skipped (nobody loses the incentive because of it), and the screen shows that the targets are not set.
Bands and steps are lookups: a row applies from its starting value up to the next row. A value below the first row uses the first row, so a missing 0 row does not zero anyone (rows 4 → 0% and 6 → 50% deducted give workers with 0 to 3 days absent a 0% deduction). No bands means no deduction, and two rows cannot start at the same value. A shift with no attendance bonus override uses the default steps.
Kept elsewhere (already exist or belong to another screen):
- Line efficiency target → Line Target screen
Database Changes
Section titled “Database Changes”| Change | Where | Why |
|---|---|---|
New config type Incentive | Config.Config (one row) | Holds the incentive settings |
New column OperationCategory (Critical, Standard or Helping; required, default Standard) | Essentials.Operation | Category of each operation |
New tables WorkerIncentiveMonth and WorkerIncentive | Incentive | Save a posted month: its settings and who posted it, and every worker’s calculation inputs, amount before override and override |
Nothing else is added. All other data is read from existing reporting_dw datasets until a month is posted.
Screen
Section titled “Screen”Worker Incentive: pick a month, see every worker present in the month grouped by factory, then branch, then line, with each step’s result, the amount before override, and the net payable.
- It opens on the last finished incentive month, because the current one is still running. For example, with start day 3, on 6 October it opens on September (3 September to 2 October).
- The dates the month covers are shown next to the month picker.
- The Export button downloads every listed worker of the month as an Excel file, with the same figures as the table: days, deductions, efficiency and DHU, base, overtime, final incentive, attendance bonus, net payable and the override reason.
Every worker present on at least one day of the month is listed once, under the line where they were present the most days. A worker below the minimum days on one line shows, in the Days on Line column, the days in red and the Deduction from the settings (default 100%, so the incentive is 0), and the attendance bonus is still paid. Disabled workers and workers not present on any day of the month are not shown.
Workers are grouped by factory, branch and line, and listed in the order they were added.
Who can open it is controlled by the existing Keycloak role spts:incentive:manage, the same as the other incentive screens. The same role allows overriding, posting and deleting a posted month. No feature flag is needed.
Incentive Settings: edit the settings listed in Settings. Same Keycloak role.
Good to Know
Section titled “Good to Know”- Kept simple on purpose (the client document asks for more):
- Settings keep only the current values, with no history per month. A posted month keeps the figures it was posted with.
- Targets are general values the admin can update any time, not set separately for each month.
- The override changes only the net payable of one worker. No overrides for a whole line or group.
- Operation Category is filled by our own rule (from
IsCriticaland operation type), not the client document’s list of operation names.