> For the complete documentation index, see [llms.txt](https://kb.theloops.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.theloops.io/agentstudio/skills-library/human-capital-management/flag-employment-end-date-risk.md). Agents can also search and read this documentation through its [MCP server](https://kb.theloops.io/~gitbook/mcp).

# Flag Employment End Date Risk

Flags one employment approaching its leaving date without a defined next step. Read-only.

| Business area            | Action type |
| ------------------------ | ----------- |
| Human Capital Management | Read-only   |

## Overview

In IFS Cloud the employment periods of an employee are stored in EmpEmployedTime (DateOfEmployment, DateOfLeaving, LeavingCauseType, EmploymentEndReason, LeavingNotificationDate). The Personnel File (PersonnelFileHandling.CompanyPersonSet) exposes the derived current values: AccountDate (date of leaving from Emp\_Employed\_Time\_API.Get\_Date\_Of\_Leaving), PeriodEndDate, CurrentlyEmployed and TerminationProcessId (the latest non-invalid termination process).

Reads personnel file employment and termination data.

## How it works

{% stepper %}
{% step %}
Context: PersonnelFile CompanyPersonSet.
{% endstep %}

{% step %}
Periods: PeriodsSet navigation.
{% endstep %}

{% step %}
Termination: TerminateEmpActivityLogs.
{% endstep %}

{% step %}
Other: Employments array.
{% endstep %}

{% step %}
Self: EmployeeInfoEmployment Employees.
{% endstep %}
{% endstepper %}

## Key capabilities

* Reads the current employment header with leaving date, period end, current employment flag and termination process ID.
* Lists all employment periods with leaving cause, end reason and leaving notification date.
* Detects a follow-on period that starts after the current leaving date (extension already registered).
* Reads the status of an existing termination process and its open checklist activities.
* Checks for active employments of the same person in other companies (possible internal transfer).
* Computes days to leaving date against a configurable horizon and classifies risk.
* Distinguishes open-ended employment (no end date) from planned and overdue end dates.
* Returns evidence, verdict and a recommended next action, never writes.

## Requirements

The following IFS Cloud components and projections must be available, with permission sets that grant access to each projection.

| Component | Projection                              |
| --------- | --------------------------------------- |
| PERSON    | PersonnelFileHandling                   |
| PERSON    | PersonnelFileEmployementPeriodsHandling |
| PERSON    | TerminateEmploymentLogsHandling         |
| PERSON    | EmployeeInfoEmploymentHandling          |

## Version compatibility

| Projection                              | Supported IFS Cloud releases |
| --------------------------------------- | ---------------------------- |
| PersonnelFileHandling                   | 24R2, 25R1, 25R2, 26R1, 26R2 |
| PersonnelFileEmployementPeriodsHandling | 24R2, 25R1, 25R2, 26R1, 26R2 |
| TerminateEmploymentLogsHandling         | 24R2, 25R1, 25R2, 26R1, 26R2 |
| EmployeeInfoEmploymentHandling          | 24R2, 25R1, 25R2, 26R1, 26R2 |

## Known limitations

* Read-only: does not create, update, or delete IFS Cloud data.
