# Recalculate workload ## When to recalculate Department workload recalculation compares the current `/workload/item/:id` record with its source learning plans, baseline data, united subjects, calculation rules and norms. Use it after source changes to inspect which rows and hours need updating. Open [workload details](/en/docs/workload-details). Save unfinished assignments on both tabs before recalculating. The UI will not start a new preview while drafts or an approval lock are present. ## Preview Select recalculation from the record actions. The system first builds a preview; the workload has not yet been changed. Both ordinary tabs are temporarily replaced with review tables: the first shows subject, calculation and educator-assignment changes, the second norm-row changes. 1. Enable Only changes to hide unchanged rows. 2. Search and filter by course, semester or profession. Expand a subject to review its educator assignments. 3. Compare before and after values and the reason for each change. Additions show the proposed new value, removals show the original value, and updates show a comparison. Unchanged rows provide context. 4. Review the second tab as well, even if recalculation was started on the first. Confirmation applies to the reviewed plan as a whole. | Example source change | What to inspect | | --- | --- | | Calculated subject hours change | Before and after values for teaching formats, assessment and standards. | | A matching learning-plan row is added | A new subject is proposed. | | A subject no longer belongs to the department or current selection, or is replaced by a united subject | The old subject and educator assignments may be proposed for deletion. | | A norm formula changes | Compare the existing norm assignment total. | | A norm is deleted, no longer matches course, semester, degree or format, or the baseline block is missing | The norm assignment may be removed. | Recalculation updates subject calculation fields. Saved educator assignments are reviewed separately. In the current recalculation plan, removal of a source subject includes removal of its educator assignments. Check whether hours need redistribution after applying. ## Exclude changes Changes are initially selected for application. With the separate exclusion permission, uncheck changes you want to retain as-is or postpone adding. Exclusion applies to this operation and does not change source learning plans or general settings. - Excluding a subject change excludes its educator-assignment changes. - When deletion of a child assignment is excluded, deletion of its parent subject is excluded as well. An assignment cannot remain if its parent has been removed. - You can exclude a new subject addition, an existing subject update or deletion, an educator-assignment deletion, or a norm-row update or deletion. **Example.** The preview proposes removing an obsolete subject and two assignments, adding a new subject and increasing a norm from 8 to 10 hours. If the owner needs the old assignments for now, exclude deletion of the old subject and verify that its assignment deletions are excluded too. Keep the new subject and norm change selected if they are correct. ## Save or cancel Click Save (N), where N is the number of included changes. The button is disabled when there are no included changes. The server applies valid, non-excluded changes in a transaction. Cancel closes review without writing the result. A preview is tied to the user, workload and calculated state for 30 minutes. If another user changes the workload or source calculation during review, confirmation may report a stale preview. Refresh the preview and review exclusions and values again. Building a new preview clears exclusion selections. After saving, review both ordinary tabs, including [lesson allocation](/en/docs/workload-details) and [norm assignments](/en/docs/workload-teaching-load). Redistribute changed calculated hours if necessary. Recalculation updates and deletions are reflected in the available operation history. ## Permissions and scope Recalculation belongs to `wl-lesson-allocation` and supports the `department` scope of the workload. | Operation | Permission | | --- | --- | | Generate preview | `employee-workload.recalculation` | | Exclude changes | `employee-workload.recalculation-exclude` — separately enforced by the server | | Confirm | `employee-workload.recalculation-confirm`; the frontend action group also requires workload and norm reading and preview access. | During an approval lock, the server rejects confirmation by regular staff. The UI also accounts for locking and unsaved data. If the action is unavailable, finish current edits and check permissions and approval status. If results are unexpected, compare the sources with [workload settings](/en/docs/workload-settings), [baseline data](/en/docs/baseline-data-details), and current learning-plan and group composition. ## Implementation references - [RecalculationContext.tsx](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/Workload/components/WorkloadRecalculation/RecalculationContext.tsx) - [RecalculationTable.tsx](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/Workload/components/WorkloadRecalculation/RecalculationTable.tsx) - [types.ts](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/Workload/components/WorkloadRecalculation/types.ts) - [WorkloadItemActions.tsx](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/Workload/components/WorkloadItem/components/WorkloadItemActions/WorkloadItemActions.tsx) - [thunk.ts](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/LearningManagement/Workload/store/thunk.ts) - [permissionActionMap.json](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/public/permissionActionMap.json) - [api.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/EmployeeWorkload/routes/api.php) - [WorkloadRecalculationController.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/EmployeeWorkload/Http/Controllers/WorkloadRecalculationController.php) - [WorkloadRecalculationRequest.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/EmployeeWorkload/Http/Requests/WorkloadRecalculationRequest.php) - [WorkloadRecalculationService.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/EmployeeWorkload/Services/WorkloadRecalculationService.php)