Class PayrunWageTypeAvailableFunction
Determines whether a specific wage type is evaluated for an employee in the current payrun (default: true).
Implements
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Function
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public class PayrunWageTypeAvailableFunction : PayrunFunction, IDisposable
Remarks
This function is evaluated once per wage type per employee, before
WageTypeValueFunction runs. Returning false skips the wage type
entirely for this employee in this payrun run: no value is calculated, no result is
stored, and no collectors are fed by that wage type.
The current wage type is identified by WageTypeNumber. Use this to write a single function body that handles multiple wage types differently based on their number.
Typical uses:
- Restrict a bonus wage type to a specific period, for example December only.
- Skip a wage type for employees who do not qualify (e.g. no relevant case value).
- Disable a wage type during retro runs by testing IsRetroPayrun.
Return value: Return true or null to evaluate the wage type.
Return false to skip it.
Examples
// Only evaluate wage type 2250 in December
WageTypeNumber == 2250 && PeriodStart.Month == 12
// Skip any wage type for employees without a salary case value
GetCaseValue<decimal?>("Salary").HasValue
Constructors
View SourcePayrunWageTypeAvailableFunction(object)
Initializes a new instance with the function runtime
Declaration
public PayrunWageTypeAvailableFunction(object runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| object | runtime | The runtime |
PayrunWageTypeAvailableFunction(string)
New function instance without runtime (scripting development)
Declaration
protected PayrunWageTypeAvailableFunction(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
Properties
View SourceWageTypeNumber
The wage type number
Declaration
public decimal WageTypeNumber { get; }
Property Value
| Type | Description |
|---|---|
| decimal |
Methods
View SourceGetWageTypeAttribute(string)
Get wage type attribute value
Declaration
public object GetWageTypeAttribute(string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName |
Returns
| Type | Description |
|---|---|
| object |
GetWageTypeAttribute<T>(string, T)
Get wage type attribute typed value
Declaration
public T GetWageTypeAttribute<T>(string attributeName, T defaultValue = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | |
| T | defaultValue |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
IsAvailable()
Entry point for the runtime
Declaration
public bool? IsAvailable()
Returns
| Type | Description |
|---|---|
| bool? |
Remarks
Internal usage only, do not call this method