Interface IPayrollRuntime
Runtime during the execution of a payroll scripting function
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Runtime
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public interface IPayrollRuntime : IRuntime
Properties
DivisionId
The division id
Declaration
int DivisionId { get; }
Property Value
| Type | Description |
|---|---|
| int |
EmployeeId
The employee id
Declaration
int? EmployeeId { get; }
Property Value
| Type | Description |
|---|---|
| int? |
EmployeeIdentifier
The employee identifier
Declaration
string EmployeeIdentifier { get; }
Property Value
| Type | Description |
|---|---|
| string |
EvaluationDate
The evaluation date
Declaration
DateTime EvaluationDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Namespace
The script namespace
Declaration
string Namespace { get; }
Property Value
| Type | Description |
|---|---|
| string |
PayrollCulture
The payroll culture
Declaration
string PayrollCulture { get; }
Property Value
| Type | Description |
|---|---|
| string |
PayrollId
The payroll id
Declaration
int PayrollId { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
ApplyRangeValue(string, decimal, string)
Apply a range value to the lookup ranges, and multiplying the lookup value with the range amount
Declaration
decimal ApplyRangeValue(string lookupName, decimal rangeValue, string valueFieldName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | The lookup name |
| decimal | rangeValue | The range value |
| string | valueFieldName | Value field name |
Returns
| Type | Description |
|---|---|
| decimal | Summary of all lookup ranges |
Remarks
Only numeric JSON lookup values are supported. The first lookup range value must be zero.
GetCaseFieldAttribute(string, string)
Get case field attribute value
Declaration
object GetCaseFieldAttribute(string caseFieldName, string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The name of the case field |
| string | attributeName | Name of the attribute |
Returns
| Type | Description |
|---|---|
| object | The case field attribute value |
GetCasePeriodValues(DateTime, DateTime, params string[])
Get case period values of multiple cases by date range and case field name
Declaration
Dictionary<string, List<Tuple<DateTime, DateTime?, DateTime?, object>>> GetCasePeriodValues(DateTime startDate, DateTime endDate, params string[] caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | startDate | The time period start date |
| DateTime | endDate | The time period end date |
| string[] | caseFieldNames | The name of the case fields |
Returns
| Type | Description |
|---|---|
| Dictionary<string, List<Tuple<DateTime, DateTime?, DateTime?, object>>> | The period values of multiple cases |
GetCaseValue(string, DateTime)
Get case value from a specific moment
Declaration
Tuple<string, DateTime, Tuple<DateTime?, DateTime?>, object, DateTime?, List<string>, Dictionary<string, object>> GetCaseValue(string caseFieldName, DateTime valueDate)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The case field name |
| DateTime | valueDate | The value date |
Returns
| Type | Description |
|---|---|
| Tuple<string, DateTime, Tuple<DateTime?, DateTime?>, object, DateTime?, List<string>, Dictionary<string, object>> | Case value from a specific date |
Remarks
Use nested tuples to reduce the tuple item count to 7
GetCaseValueAttribute(string, string)
Get case field value attribute value
Declaration
object GetCaseValueAttribute(string caseFieldName, string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The name of the case field |
| string | attributeName | Name of the attribute |
Returns
| Type | Description |
|---|---|
| object | The case field value attribute value |
GetCaseValueSlots(string)
Get the case value slots
Declaration
List<string> GetCaseValueSlots(string caseFieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The name of the case field |
Returns
| Type | Description |
|---|---|
| List<string> | The case slot names, empty on unknown case field |
GetCaseValueTags(string, DateTime)
Get the case value tags
Declaration
List<string> GetCaseValueTags(string caseFieldName, DateTime valueDate)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The name of the case field |
| DateTime | valueDate | The value date |
Returns
| Type | Description |
|---|---|
| List<string> | The case value tas, empty on unknown case field |
GetCaseValueType(string)
Get case value type
Declaration
int? GetCaseValueType(string caseFieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The case field name |
Returns
| Type | Description |
|---|---|
| int? | The case value type |
GetCaseValues(IList<string>, DateTime)
Get case values from a specific moment
Declaration
List<Tuple<string, DateTime, Tuple<DateTime?, DateTime?>, object, DateTime?, List<string>, Dictionary<string, object>>> GetCaseValues(IList<string> caseFieldNames, DateTime valueDate)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<string> | caseFieldNames | The case field names |
| DateTime | valueDate | The value date |
Returns
| Type | Description |
|---|---|
| List<Tuple<string, DateTime, Tuple<DateTime?, DateTime?>, object, DateTime?, List<string>, Dictionary<string, object>>> | Case value from a specific date |
Remarks
Use nested tuples to reduce the tuple item count to 7
GetCaseValues(string, DateTime?, DateTime?)
Get case values by date range
Declaration
List<Tuple<string, DateTime, Tuple<DateTime?, DateTime?>, object, DateTime?, List<string>, Dictionary<string, object>>> GetCaseValues(string caseFieldName, DateTime? startDate = null, DateTime? endDate = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The case field name |
| DateTime? | startDate | The date after the case value was created |
| DateTime? | endDate | The date before the case value was created |
Returns
| Type | Description |
|---|---|
| List<Tuple<string, DateTime, Tuple<DateTime?, DateTime?>, object, DateTime?, List<string>, Dictionary<string, object>>> | Case values from the current period |
Remarks
Use nested tuples to reduce the tuple item count to 7
GetCycle(DateTime, int)
Get cycle by moment and offset
Declaration
Tuple<DateTime, DateTime> GetCycle(DateTime cycleMoment, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | cycleMoment | The cycle moment |
| int | offset | The cycle offset: 0=current, -1=previous, 1=next |
Returns
| Type | Description |
|---|---|
| Tuple<DateTime, DateTime> | The offset cycle including the moment |
GetEmployeeAttribute(string)
Get employee attribute value
Declaration
object GetEmployeeAttribute(string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | Name of the attribute |
Returns
| Type | Description |
|---|---|
| object | The employee attribute value |
GetEvaluationPeriod()
Get evaluation period
Declaration
Tuple<DateTime, DateTime> GetEvaluationPeriod()
Returns
| Type | Description |
|---|---|
| Tuple<DateTime, DateTime> |
GetLookup(string, string, string)
Get lookup value by key
Declaration
string GetLookup(string lookupName, string lookupKey, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | The name of the lookup |
| string | lookupKey | The lookup value key |
| string | culture | The value culture |
Returns
| Type | Description |
|---|---|
| string | The lookup value matching tho the lookup key |
GetLookupRanges(string, decimal?)
Get payroll lookup range brackets
Declaration
List<Tuple<string, string, decimal, decimal, decimal?>> GetLookupRanges(string lookupName, decimal? rangeValue = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | The name of the lookup |
| decimal? | rangeValue | The range value (supported by threshold and progressive lookups) |
Returns
| Type | Description |
|---|---|
| List<Tuple<string, string, decimal, decimal, decimal?>> | List of lookup range brackets |
Remarks
Use nested tuples to reduce the tuple item count to 7
GetPeriod(DateTime, int)
Get period by moment and offset
Declaration
Tuple<DateTime, DateTime> GetPeriod(DateTime periodMoment, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | periodMoment | The period moment |
| int | offset | The period offset: 0=current, -1=previous, 1=next |
Returns
| Type | Description |
|---|---|
| Tuple<DateTime, DateTime> | The offset period including the moment |
GetRangeLookup(string, decimal, string, string)
Get lookup value by range
Declaration
string GetRangeLookup(string lookupName, decimal rangeValue, string lookupKey = null, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | The name of the lookup |
| decimal | rangeValue | The range value |
| string | lookupKey | The lookup key |
| string | culture | The value culture |
Returns
| Type | Description |
|---|---|
| string | The lookup value matching tho the lookup key |
HasLookup(string)
Test for existing lookup
Declaration
bool HasLookup(string lookupName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | The name of the lookup |
Returns
| Type | Description |
|---|---|
| bool | True on existing lookup |