Show / Hide Table of Contents

Class PayrollRuntime

Runtime for the payroll function

Inheritance
object
RuntimeBase
PayrollRuntime
CaseRelationRuntimeBase
CaseRuntimeBase
PayrunRuntimeBase
Implements
IPayrollRuntime
IRuntime
Inherited Members
RuntimeBase.GetTenantAttribute(string)
RuntimeBase.GetUserAttribute(string)
RuntimeBase.GetDerivedCulture(int, int)
RuntimeBase.GetDerivedCalendar(int, int)
RuntimeBase.GetCalendarDayCount(string, DateTime, DateTime, string)
RuntimeBase.IsCalendarWorkDay(string, DateTime)
RuntimeBase.GetPreviousWorkDays(string, DateTime)
RuntimeBase.GetNextWorkDays(string, DateTime)
RuntimeBase.GetCalendarPeriod(string, DateTime, int, string)
RuntimeBase.AddLog(int, string, string, string)
RuntimeBase.AddTask(string, string, DateTime, string, Dictionary<string, object>)
RuntimeBase.InvokeWebhook(string, string)
RuntimeBase.HttpClient
RuntimeBase.TenantService
RuntimeBase.UserService
RuntimeBase.Tenant
RuntimeBase.TenantCulture
RuntimeBase.TenantId
RuntimeBase.TenantIdentifier
RuntimeBase.User
RuntimeBase.UserId
RuntimeBase.UserIdentifier
RuntimeBase.UserCulture
RuntimeBase.UserType
RuntimeBase.LogOwner
RuntimeBase.LogOwnerType
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: PayrollEngine.Client.Scripting.Runtime.Api
Assembly: PayrollEngine.Client.Services.dll
Syntax
public abstract class PayrollRuntime : RuntimeBase, IPayrollRuntime, IRuntime

Constructors

View Source

PayrollRuntime(PayrollHttpClient, ScriptContext, int, int, int, int?)

Initializes a new instance of the PayrollRuntime class

Declaration
protected PayrollRuntime(PayrollHttpClient httpClient, ScriptContext scriptContext, int tenantId, int userId, int payrollId, int? employeeId = null)
Parameters
Type Name Description
PayrollHttpClient httpClient

The Payroll http client

ScriptContext scriptContext

The calendar

int tenantId

The tenant id

int userId

The user id

int payrollId

The payroll id

int? employeeId

The employee id

Properties

View Source

CalendarService

The calendar service

Declaration
protected ICalendarService CalendarService { get; }
Property Value
Type Description
ICalendarService
View Source

Cycle

The payroll cycle

Declaration
public IPayrollPeriod Cycle { get; }
Property Value
Type Description
IPayrollPeriod
View Source

DivisionId

The division id

Declaration
public int DivisionId { get; }
Property Value
Type Description
int
View Source

Employee

The employee

Declaration
protected Employee Employee { get; }
Property Value
Type Description
Employee
View Source

EmployeeId

The employee id

Declaration
public int? EmployeeId { get; }
Property Value
Type Description
int?
View Source

EmployeeIdentifier

The employee identifier

Declaration
public string EmployeeIdentifier { get; }
Property Value
Type Description
string
View Source

EmployeeService

The employee service

Declaration
protected IEmployeeService EmployeeService { get; }
Property Value
Type Description
IEmployeeService
View Source

EvaluationDate

The evaluation date

Declaration
public DateTime EvaluationDate { get; }
Property Value
Type Description
DateTime
View Source

Namespace

The script namespace

Declaration
public string Namespace { get; }
Property Value
Type Description
string
View Source

Payroll

The payroll

Declaration
public Payroll Payroll { get; }
Property Value
Type Description
Payroll
View Source

PayrollCulture

The payroll culture by priority: script > tenant > system

Declaration
public string PayrollCulture { get; }
Property Value
Type Description
string
View Source

PayrollId

The payroll id

Declaration
public int PayrollId { get; }
Property Value
Type Description
int
View Source

PayrollService

The payroll service

Declaration
protected IPayrollService PayrollService { get; }
Property Value
Type Description
IPayrollService
View Source

Period

The payroll period

Declaration
public IPayrollPeriod Period { get; }
Property Value
Type Description
IPayrollPeriod
View Source

RegulationDate

The regulation date

Declaration
public DateTime RegulationDate { get; }
Property Value
Type Description
DateTime
View Source

RegulationService

The regulation service

Declaration
protected IRegulationService RegulationService { get; }
Property Value
Type Description
IRegulationService
View Source

ScriptCalendar

The script calendar

Declaration
public ScriptCalendar ScriptCalendar { get; }
Property Value
Type Description
ScriptCalendar
View Source

ScriptContext

The script context

Declaration
public ScriptContext ScriptContext { get; }
Property Value
Type Description
ScriptContext

Methods

View Source

ApplyRangeValue(string, decimal, string)

Apply a range value to the lookup ranges, and multiplying the lookup value with the range amount

Declaration
public 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.

View Source

GetCaseFieldAttribute(string, string)

Get case field attribute value

Declaration
public virtual 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

View Source

GetCasePeriodValues(DateTime, DateTime, params string[])

Get case period values of multiple cases by date range and case field name

Declaration
public virtual 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

View Source

GetCaseValue(string, DateTime)

Get case value from a specific moment

Declaration
public virtual 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

View Source

GetCaseValueAttribute(string, string)

Get case field value attribute value

Declaration
public virtual 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

View Source

GetCaseValueSlots(string)

Get the case value slots

Declaration
public virtual 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

View Source

GetCaseValueTags(string, DateTime)

Get the case value tags

Declaration
public virtual 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

View Source

GetCaseValueType(string)

Get case value type

Declaration
public virtual int? GetCaseValueType(string caseFieldName)
Parameters
Type Name Description
string caseFieldName

The case field name

Returns
Type Description
int?

The case value type

View Source

GetCaseValues(IList<string>, DateTime)

Get case values from a specific moment

Declaration
public virtual 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

View Source

GetCaseValues(string, DateTime?, DateTime?)

Get case values by date range

Declaration
public virtual 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

View Source

GetCycle(DateTime, int)

Get cycle by moment and offset

Declaration
public virtual 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

View Source

GetEmployeeAttribute(string)

Get employee attribute value

Declaration
public virtual object GetEmployeeAttribute(string attributeName)
Parameters
Type Name Description
string attributeName

Name of the attribute

Returns
Type Description
object

The employee attribute value

View Source

GetEvaluationPeriod()

Get evaluation period

Declaration
public virtual Tuple<DateTime, DateTime> GetEvaluationPeriod()
Returns
Type Description
Tuple<DateTime, DateTime>
View Source

GetLookup(string, string, string)

Get lookup value by key

Declaration
public virtual 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

View Source

GetLookupRanges(string, decimal?)

Get payroll lookup range brackets

Declaration
public 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

View Source

GetPeriod(DateTime, int)

Get period by moment and offset

Declaration
public virtual 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

View Source

GetRangeLookup(string, decimal, string, string)

Get lookup value by range

Declaration
public virtual 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

View Source

HasLookup(string)

Test for existing lookup

Declaration
public bool HasLookup(string lookupName)
Parameters
Type Name Description
string lookupName

The name of the lookup

Returns
Type Description
bool

True on existing lookup

Implements

IPayrollRuntime
IRuntime

Extension Methods

ConsoleExtensions.WriteProperties(object, bool)
ValueTypeExtensions.GetValueType(object)
ObjectInfo.GetPropertyValue(object, string)
ObjectInfo.GetPropertyValue<T>(object, string, T)
ObjectInfo.ResolvePropertyValue(object, string)
ObjectInfo.SetPropertyValue(object, string, object)
  • View Source
☀
☾
Back to top Generated by DocFX