Class PayrunEmployeeEndFunction
Executes at the end of each employee's payrun processing, after all wage types and collectors have completed.
Implements
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Function
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public class PayrunEmployeeEndFunction : PayrunFunction, IDisposable
Remarks
This function runs once per included employee, after all wage types and their collectors have been evaluated. It is the last hook in the per-employee lifecycle and is suitable for post-processing, aggregation, and result enrichment at the employee level.
Typical uses:
- Compute final derived results from completed wage type and collector values.
- Write cross-wage-type summaries as payrun results (SetPayrunResult(string, object, ValueType?, string, IEnumerable<string>, Dictionary<string, object>, string)).
- Store per-employee summary data as a runtime value for PayrunEndFunction.
- Log completion or trigger per-employee tasks via AddTask(string, string, DateTime, string, Dictionary<string, object>).
Return value: This function returns void.
Wage type results are already committed; this hook is for side effects only.
Examples
// Persist total net pay for use in PayrunEndFunction
var netPay = WageType[9000m]; // net pay wage type number
SetEmployeeRuntimeValue("NetPay", netPay.ToString());
Constructors
View SourcePayrunEmployeeEndFunction(object)
Initializes a new instance with the function runtime
Declaration
public PayrunEmployeeEndFunction(object runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| object | runtime | The runtime |
PayrunEmployeeEndFunction(string)
New function instance without runtime (scripting development)
Declaration
protected PayrunEmployeeEndFunction(string sourceFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sourceFileName | The name of the source file |
Remarks
Use GetSourceFileName(string) in your constructor for the source file name
Methods
View SourceEnd()
Entry point for the runtime
Declaration
public void End()
Remarks
Internal usage only, do not call this method