Work Entry Regeneration
Synchronize and update work entries when changes occur
Work entry regeneration is the process of deleting and recreating work entries for a specific time period. This function is necessary when work schedule changes, data source changes, or incorrect data is detected.
When to regenerate
Key points
• Employee work schedule changes
• Data source changes (from schedule to attendance)
• Incorrect or inconsistent data detected
• Need to update entries for a time period
• After editing planning slots or attendance records
Regenerate work entries
Steps
1. Go to Payroll → Work Entries
2. Click Action → Regenerate Work Entries
3. Fill From (start date), To (end date)
4. Select Employees (employees to regenerate)
5. Click Regenerate
Wizard information
| Fields | Trường dữ liệu | Description |
|---|---|---|
| From | Từ ngày | Start date for regeneration (required) |
| To | Đến ngày | End date for regeneration (required) |
| Employees | Nhân viên | Select employees to regenerate (empty = all) |
Regeneration process
When clicking Regenerate, the system performs the following steps:
Steps
1. Find all work entries in time period (From - To) for selected employees
2. Filter only work entries in New or In Conflict state (skip Validated)
3. Delete (archive) old work entries (active=False)
4. Create new work entries based on current data source (work schedule, attendance, or planning)
5. Allocate hours according to each source rules
Important notes
Key points
• Only regenerates entries in New or In Conflict state
• In Payslip entries are not affected (protected)
• System automatically deletes old entries and creates new ones
• Cannot undo after regeneration (backup recommended)
Regeneration limits
There are some limits when regenerating work entries:
Key points
• Only regenerates in time period with existing entries
• Cannot regenerate for employees with Validated entries
• Regeneration dates must be within date_generated_from to date_generated_to of contract
• Employee must have active contract in time period
Regenerate from employee record
Can regenerate entries directly from employee record:
Steps
1. Go to Employees → Employees
2. Open employee record
3. Click Regenerate Work Entries button on top bar
4. Fill information and click Regenerate
Regenerate after data changes
When to regenerate
| Change | Need regeneration | Reason |
|---|---|---|
| Edit work schedule | Yes | Expected working hours changed |
| Edit planning slot | Yes | Work plan changed |
| Edit attendance | Automatic | System automatically regenerates |
| Change data source | Yes | Entry creation source changed |
| Edit work entry type | No | Does not affect created entries |
Handle regeneration errors
If errors occur during regeneration, check the following:
Key points
• Does employee have active contract?
• Is time period within date_generated_from/to?
• Are there Validated entries in time period?
• Does data source (work schedule, planning slots) exist?
• Do you have permission to regenerate entries (HR Manager)?
Batch regeneration
To regenerate for multiple employees at once:
Steps
1. Go to Payroll → Work Entries → Regenerate Work Entries
2. Fill From and To
3. Leave Employees empty (or select multiple employees)
4. Click Regenerate
5. System regenerates for all employees with entries in time period
Backup before regeneration
Recommended to backup data before batch regeneration:
Key points
• Export work entries to Excel: Payroll → Work Entries → Export
• Or backup database if regenerating large numbers
• Store backup for recovery if needed
Check after regeneration
Key points
• Check number of work entries before and after regeneration
• Compare total hours with source data (schedule, attendance, planning)
• Check for new conflicting work entries
• Confirm work entries created with correct type
• Check work entries linked correctly to source (attendance_id, planning_slot_id)
Practical tips
Key points
• Regenerate in small date ranges: Regenerate weekly instead of monthly for better control
• Regenerate outside work hours: Avoid regenerating when employees are entering data
• Check before regenerating: View number of work entries that will be affected
• Notify in advance: Inform team before batch regeneration
• Regenerate after data finalized: Ensure source data is accurate before regenerating
Automatic regeneration
Some cases where system automatically regenerates:
Key points
• When editing/deleting attendance: System automatically regenerates related work entries
• When editing planning slot: System automatically regenerates work entries from that slot
• When approving/refusing time off: System automatically regenerates work entries in time off period