Class PayrollFunction
Payroll function
Implements
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Function
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public abstract class PayrollFunction : Function, IDisposable
Constructors
View SourcePayrollFunction(object)
New function instance
Declaration
protected PayrollFunction(object runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| object | runtime | The function runtime |
PayrollFunction(string)
New function instance without runtime (scripting development)
Declaration
protected PayrollFunction(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
Fields
View SourceBooleanType
Boolean type name
Declaration
protected const string BooleanType = "Bool"
Field Value
| Type | Description |
|---|---|
| string |
DateType
Date type name
Declaration
protected const string DateType = "Date"
Field Value
| Type | Description |
|---|---|
| string |
DecimalType
Decimal type name
Declaration
protected const string DecimalType = "Dec"
Field Value
| Type | Description |
|---|---|
| string |
IntType
Integer type name
Declaration
protected const string IntType = "Int"
Field Value
| Type | Description |
|---|---|
| string |
NumericType
Numeric type name
Declaration
protected const string NumericType = "Num"
Field Value
| Type | Description |
|---|---|
| string |
StringType
String type name
Declaration
protected const string StringType = "String"
Field Value
| Type | Description |
|---|---|
| string |
TimeSpanType
Timespan type name
Declaration
protected const string TimeSpanType = "TimeSpan"
Field Value
| Type | Description |
|---|---|
| string |
Properties
View SourceCaseValue
Get the case payroll value by case field name
Declaration
public ScriptDictionary<string, CasePayrollValue> CaseValue { get; }
Property Value
| Type | Description |
|---|---|
| ScriptDictionary<string, CasePayrollValue> |
CaseValueTags
Get the case value tags by case field name
Declaration
public ScriptDictionary<string, List<string>> CaseValueTags { get; }
Property Value
| Type | Description |
|---|---|
| ScriptDictionary<string, List<string>> |
Cycle
The current cycle
Declaration
public DatePeriod Cycle { get; }
Property Value
| Type | Description |
|---|---|
| DatePeriod |
CycleDays
The day count of the current cycle
Declaration
[ActionProperty("Cycle day count", null)]
public int CycleDays { get; }
Property Value
| Type | Description |
|---|---|
| int |
CycleDuration
The current cycle duration
Declaration
[ActionProperty("Cycle duration", null)]
public TimeSpan CycleDuration { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
CycleEnd
The current cycle end date
Declaration
[ActionProperty("Cycle end date", null)]
public DateTime CycleEnd { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
CycleEndDay
The current cycle end day
Declaration
[ActionProperty("Cycle end day", null)]
public int CycleEndDay { get; }
Property Value
| Type | Description |
|---|---|
| int |
CycleEndMonth
The current cycle end month
Declaration
[ActionProperty("Cycle end month", null)]
public int CycleEndMonth { get; }
Property Value
| Type | Description |
|---|---|
| int |
CycleEndOffset
Offset of the current period to the end of the current cycle,
0 for the ultimate cycle period, 1 for the penultimate cycle period, and so on
Declaration
public int CycleEndOffset { get; }
Property Value
| Type | Description |
|---|---|
| int |
CycleEndYear
The current cycle end year
Declaration
[ActionProperty("Cycle end year", null)]
public int CycleEndYear { get; }
Property Value
| Type | Description |
|---|---|
| int |
CycleStart
The current cycle start date
Declaration
[ActionProperty("Cycle start date", null)]
public DateTime CycleStart { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
CycleStartDay
The current cycle start day
Declaration
[ActionProperty("Cycle start day", null)]
public int CycleStartDay { get; }
Property Value
| Type | Description |
|---|---|
| int |
CycleStartMonth
The current cycle start month
Declaration
[ActionProperty("Cycle start month", null)]
public int CycleStartMonth { get; }
Property Value
| Type | Description |
|---|---|
| int |
CycleStartOffset
Offset of the current period to the start of the current cycle,
0 for the first cycle period, -1 for the previous period, and so on
Declaration
public int CycleStartOffset { get; }
Property Value
| Type | Description |
|---|---|
| int |
CycleStartYear
The current cycle start year
Declaration
[ActionProperty("Cycle start year", null)]
public int CycleStartYear { get; }
Property Value
| Type | Description |
|---|---|
| int |
DivisionId
The division id
Declaration
public int DivisionId { get; }
Property Value
| Type | Description |
|---|---|
| int |
EmployeeId
The employee id
Declaration
public int? EmployeeId { get; }
Property Value
| Type | Description |
|---|---|
| int? |
EmployeeIdentifier
The employee identifier
Declaration
[ActionProperty("Employee identifier", null)]
public string EmployeeIdentifier { get; }
Property Value
| Type | Description |
|---|---|
| string |
EvaluationDate
The evaluation date
Declaration
[ActionProperty("Evaluation date", null)]
public DateTime EvaluationDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
EvaluationPeriod
The evaluation period
Declaration
public DatePeriod EvaluationPeriod { get; }
Property Value
| Type | Description |
|---|---|
| DatePeriod |
FirstCyclePeriod
Test for the first cycle period
Declaration
public bool FirstCyclePeriod { get; }
Property Value
| Type | Description |
|---|---|
| bool |
FutureCyclePeriods
The number of periods from the current period to the cycle end
Declaration
public int FutureCyclePeriods { get; }
Property Value
| Type | Description |
|---|---|
| int |
HasNamespace
Test for function regulation namespace
Declaration
public bool HasNamespace { get; }
Property Value
| Type | Description |
|---|---|
| bool |
LastCyclePeriod
Test for the last cycle period
Declaration
public bool LastCyclePeriod { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Namespace
The function regulation namespace
Declaration
[ActionProperty("Regulation namespace", null)]
public string Namespace { get; }
Property Value
| Type | Description |
|---|---|
| string |
NextCycle
The next cycle
Declaration
public DatePeriod NextCycle { get; }
Property Value
| Type | Description |
|---|---|
| DatePeriod |
NextPeriod
The next period
Declaration
public DatePeriod NextPeriod { get; }
Property Value
| Type | Description |
|---|---|
| DatePeriod |
None
None value
Declaration
protected dynamic None { get; }
Property Value
| Type | Description |
|---|---|
| dynamic |
Null
Null value
Declaration
protected dynamic Null { get; }
Property Value
| Type | Description |
|---|---|
| dynamic |
PastCyclePeriods
The number of periods from the cycle start of the current period
Declaration
public int PastCyclePeriods { get; }
Property Value
| Type | Description |
|---|---|
| int |
PayrollCulture
The payroll culture
Declaration
public string PayrollCulture { get; }
Property Value
| Type | Description |
|---|---|
| string |
PayrollId
The payroll id
Declaration
public int PayrollId { get; }
Property Value
| Type | Description |
|---|---|
| int |
Period
The current period
Declaration
public DatePeriod Period { get; }
Property Value
| Type | Description |
|---|---|
| DatePeriod |
PeriodDays
The day count of the current period
Declaration
[ActionProperty("Period day count", null)]
public int PeriodDays { get; }
Property Value
| Type | Description |
|---|---|
| int |
PeriodDuration
The current period duration
Declaration
[ActionProperty("Period duration", null)]
public TimeSpan PeriodDuration { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
PeriodEnd
The current period end date
Declaration
[ActionProperty("Period end date", null)]
public DateTime PeriodEnd { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
PeriodEndDay
The current period end day
Declaration
[ActionProperty("Period end day", null)]
public int PeriodEndDay { get; }
Property Value
| Type | Description |
|---|---|
| int |
PeriodEndMonth
The current period end month
Declaration
[ActionProperty("Period end month", null)]
public int PeriodEndMonth { get; }
Property Value
| Type | Description |
|---|---|
| int |
PeriodEndYear
The current period end year
Declaration
[ActionProperty("Period end year", null)]
public int PeriodEndYear { get; }
Property Value
| Type | Description |
|---|---|
| int |
PeriodStart
The current period start date
Declaration
[ActionProperty("Period start date", null)]
public DateTime PeriodStart { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
PeriodStartDay
The current period start day
Declaration
[ActionProperty("Period start day", null)]
public int PeriodStartDay { get; }
Property Value
| Type | Description |
|---|---|
| int |
PeriodStartMonth
The current period start month
Declaration
[ActionProperty("Period start month", null)]
public int PeriodStartMonth { get; }
Property Value
| Type | Description |
|---|---|
| int |
PeriodStartYear
The current period start year
Declaration
[ActionProperty("Period start year", null)]
public int PeriodStartYear { get; }
Property Value
| Type | Description |
|---|---|
| int |
Periods
Periods by offset
Declaration
public ScriptDictionary<int, DatePeriod> Periods { get; }
Property Value
| Type | Description |
|---|---|
| ScriptDictionary<int, DatePeriod> |
PeriodsInCycle
The number of periods within a cycle
Declaration
public int PeriodsInCycle { get; }
Property Value
| Type | Description |
|---|---|
| int |
PreviousCycle
The previous cycle
Declaration
public DatePeriod PreviousCycle { get; }
Property Value
| Type | Description |
|---|---|
| DatePeriod |
PreviousPeriod
The previous period
Declaration
public DatePeriod PreviousPeriod { get; }
Property Value
| Type | Description |
|---|---|
| DatePeriod |
Methods
View SourceAge(ActionValue, ActionValue)
Get persons age
Declaration
[ActionParameter("birthDate", "The persons birth date", new string[] { "Date" }, null, null)]
[ActionParameter("testDate", "Reference date (default: utc-now)", new string[] { "Date" }, null, null)]
[PayrollAction("Age", "Get persons age", new string[] { "Date" })]
public ActionValue Age(ActionValue birthDate, ActionValue testDate = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | birthDate | |
| ActionValue | testDate |
Returns
| Type | Description |
|---|---|
| ActionValue | True, if source is listed in tests |
ApplyRangeLookupValue(string, decimal, string)
Apply a range value to the lookup ranges considering the lookup range mode
Declaration
[ActionParameter("lookup", "The lookup name", new string[] { "String" }, null, null)]
[ActionParameter("range", "The range value", new string[] { "Dec" }, null, null)]
[ActionParameter("field", "The JSON value field name (optional)", null, null, null)]
[PayrollAction("ApplyRangeLookupValue", "Apply a range value to the lookup ranges considering the lookup range mode", new string[] { "Lookup" })]
public ActionValue ApplyRangeLookupValue(string lookup, decimal range, string field = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookup | Lookup name |
| decimal | range | Range value |
| string | field | Object field name |
Returns
| Type | Description |
|---|---|
| ActionValue |
ApplyRangeValue(string, decimal, string)
Applies a value progressively across all range brackets and returns the total tax or contribution amount
Declaration
public decimal ApplyRangeValue(string lookupName, decimal rangeValue, string valueFieldName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | PascalCase name of the progressive range lookup |
| decimal | rangeValue | The gross amount to distribute across the brackets |
| string | valueFieldName | Optional JSON field name when the lookup value is a JSON object (e.g. |
Returns
| Type | Description |
|---|---|
| decimal | The sum of (bracket width × rate) across all brackets covered by |
Remarks
Implements progressive (bracket-by-bracket) calculations for tax and social-contribution tables. Each bracket's contribution = (min(rangeValue, bracketTop) - bracketBottom) × rate. The first bracket must start at zero. Only numeric JSON lookup values are supported. For a simple threshold lookup (flat rate per bracket) use GetRangeLookup<T>(string, decimal, string, string).
Examples
// Progressive income-tax lookup: spread the taxable amount across rate brackets
var taxAmount = ApplyRangeValue("IncomeTaxRates", taxableIncome);
View Source
CaseFieldSlot(string, string)
Get the case field name including the case slot
Declaration
public string CaseFieldSlot(string caseFieldName, string caseSlot)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The case field name |
| string | caseSlot | The case slot |
Returns
| Type | Description |
|---|---|
| string | The case field slot name |
Concat(params ActionValue[])
Concat multiple strings
Declaration
[ActionParameter("values", "Value collection", new string[] { "String" }, null, null)]
[PayrollAction("Concat", "Concat multiple strings", new string[] { "String" })]
public ActionValue Concat(params ActionValue[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue[] | values | Values to concat |
Returns
| Type | Description |
|---|---|
| ActionValue | True, if source is listed in tests |
Contains(ActionValue, params ActionValue[])
Test if value is from a specific value domain
Declaration
[ActionParameter("values", "Value collection", new string[] { "Num", "Date", "String" }, null, null)]
[PayrollAction("Contains", "Test if value is from a specific value domain", new string[] { "String" })]
public bool Contains(ActionValue source, params ActionValue[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | source | Object to test |
| ActionValue[] | values | Available values |
Returns
| Type | Description |
|---|---|
| bool | True, if source is listed in tests |
FuturePeriod()
Get period after the evaluation date
Declaration
public DatePeriod FuturePeriod()
Returns
| Type | Description |
|---|---|
| DatePeriod | Period from the evaluation date until the maximal date |
GetAttributeIssue(string, params object[])
Get issue from attribute
Declaration
public string GetAttributeIssue(string attributeName, params object[] parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | Attribute name |
| object[] | parameters | Message parameters |
Returns
| Type | Description |
|---|---|
| string |
GetCalendarDayCount(string)
Counts calendar days in the current evaluation period using the payroll calendar
Declaration
public int GetCalendarDayCount(string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | culture | The calendar culture (default: payroll culture) |
Returns
| Type | Description |
|---|---|
| int | Number of calendar days in the current evaluation period |
GetCalendarPeriod(DateTime?, int)
Gets the calendar period
Declaration
public DatePeriod GetCalendarPeriod(DateTime? moment = null, int offset = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime? | moment | Moment within the period (default: today) |
| int | offset | The period offset (default: 0/current) |
Returns
| Type | Description |
|---|---|
| DatePeriod | The period start and end date |
GetCaseFieldAttribute(string, string)
Get case field attribute value
Declaration
public object GetCaseFieldAttribute(string caseFieldName, string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | Name of the case field |
| string | attributeName | The attribute name |
Returns
| Type | Description |
|---|---|
| object |
GetCaseFieldAttribute<T>(string, string, T)
Get case attribute typed value
Declaration
public T GetCaseFieldAttribute<T>(string caseFieldName, string attributeName, T defaultValue = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | Name of the case field |
| string | attributeName | The attribute name |
| T | defaultValue | The default value |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetCaseObjectValues<T>(bool, bool)
Get case data object with the current period value
Declaration
public List<CasePayrollValue> GetCaseObjectValues<T>(bool recursive = true, bool writeable = false) where T : class, ICaseObject, new()
Parameters
| Type | Name | Description |
|---|---|---|
| bool | recursive | Recursive objects (default: true) |
| bool | writeable | Writeable values only |
Returns
| Type | Description |
|---|---|
| List<CasePayrollValue> | Data object with change data |
Type Parameters
| Name | Description |
|---|---|
| T |
GetCaseObject<T>(List<CasePayrollValue>, DateTime)
Get case data object by y moment within the payroll values
Declaration
public T GetCaseObject<T>(List<CasePayrollValue> caseValues, DateTime moment) where T : class, ICaseObject, new()
Parameters
| Type | Name | Description |
|---|---|---|
| List<CasePayrollValue> | caseValues | Case payroll values |
| DateTime | moment | Value moment |
Returns
| Type | Description |
|---|---|
| T | Data object with change data |
Type Parameters
| Name | Description |
|---|---|
| T |
GetCaseValue(string, string)
Returns the CasePayrollValue of a case field for the current payroll period
Declaration
public CasePayrollValue GetCaseValue(string caseFieldName, string caseSlot = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | PascalCase name of the case field |
| string | caseSlot | Optional slot name for multi-slot case fields |
Returns
| Type | Description |
|---|---|
| CasePayrollValue | The CasePayrollValue wrapper; call HasValue before accessing the value |
Remarks
Use the untyped overload when you need to inspect HasValue, PeriodValues, or the raw value object. For direct typed access prefer GetCaseValue<T>(string, string).
GetCaseValueAttribute(string, string)
Get case field value attribute value
Declaration
public object GetCaseValueAttribute(string caseFieldName, string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | Name of the case field |
| string | attributeName | The attribute name |
Returns
| Type | Description |
|---|---|
| object |
GetCaseValueAttribute<T>(string, string, T)
Get case field value attribute typed value
Declaration
public T GetCaseValueAttribute<T>(string caseFieldName, string attributeName, T defaultValue = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | Name of the case field |
| string | attributeName | The attribute name |
| T | defaultValue | The default value |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetCaseValueSlots(string)
Returns all slot names that have a value for the given case field
Declaration
public List<string> GetCaseValueSlots(string caseFieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | PascalCase name of the case field |
Returns
| Type | Description |
|---|---|
| List<string> | List of slot name strings; empty list when the field has no slots |
Remarks
Slots allow multiple independent values to coexist on the same case field (e.g. one entry per insurance contract). Combine with GetSlotValues<T>(string) to read all slot values at once, or with CaseFieldSlot(string, string) to address a specific slot.
GetCaseValueTags(string)
Get the case value tags from the current period end
Declaration
public List<string> GetCaseValueTags(string caseFieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | Name of the case field |
Returns
| Type | Description |
|---|---|
| List<string> | The case value tags |
GetCaseValueTags(string, DateTime)
Get the case value tags from specific date
Declaration
public List<string> GetCaseValueTags(string caseFieldName, DateTime valueDate)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | Name of the case field |
| DateTime | valueDate | The value date |
Returns
| Type | Description |
|---|---|
| List<string> | The case value tags |
GetCaseValueType(string)
Get case value type
Declaration
public ValueType? GetCaseValueType(string caseFieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The case field name |
Returns
| Type | Description |
|---|---|
| ValueType? | The case value type |
GetCaseValue<T>(string, string)
Returns the typed value of a case field for the current payroll period
Declaration
public T GetCaseValue<T>(string caseFieldName, string caseSlot = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | PascalCase name of the case field |
| string | caseSlot | Optional slot name for multi-slot case fields |
Returns
| Type | Description |
|---|---|
| T | The case field value cast to |
Type Parameters
| Name | Description |
|---|---|
| T | The expected value type (e.g. |
Remarks
This is the primary method for reading employee, company, national, and global case data inside payrun and case functions. The value returned is the one active at the end of the current period (PeriodEnd). Use GetPeriodCaseValue<T>(DatePeriod, string, string) to query a different period, or GetRawCaseValue<T>(string, DateTime) to read a value at a specific date.
Examples
var salary = GetCaseValue<decimal>("MonthlySalary");
var status = GetCaseValue<string>("ContractType");
View Source
GetCaseValues(params string[])
Returns the values of multiple case fields for the current period in a single call
Declaration
public CasePayrollValueDictionary GetCaseValues(params string[] caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | caseFieldNames | One or more PascalCase case field names |
Returns
| Type | Description |
|---|---|
| CasePayrollValueDictionary | A dictionary keyed by case field name; missing fields are absent from the dictionary |
Remarks
More efficient than multiple individual GetCaseValue<T>(string, string) calls when reading several fields at once (e.g. all fields of a salary breakdown).
GetCycle(DateTime, int)
Get cycle by moment
Declaration
public DatePeriod GetCycle(DateTime moment, int offset = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | moment | The cycle moment |
| int | offset | The cycle offset: 0=current, -1=previous, 1=next |
Returns
| Type | Description |
|---|---|
| DatePeriod | The cycle including the moment |
GetCycle(int)
Returns the payroll cycle at a given offset relative to the current cycle
Declaration
public DatePeriod GetCycle(int offset = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | offset | Cycle offset: |
Returns
| Type | Description |
|---|---|
| DatePeriod | The DatePeriod spanning the full cycle (e.g. 1 Jan – 31 Dec for annual) |
Remarks
A cycle is typically one calendar year for a monthly payroll. Use GetCyclePeriods() to iterate over all periods within the cycle, or GetPastCyclePeriods(bool) / GetFutureCyclePeriods(bool) for partial iteration.
GetCyclePeriods()
Get cycle periods
Declaration
public List<DatePeriod> GetCyclePeriods()
Returns
| Type | Description |
|---|---|
| List<DatePeriod> | The cycle periods ordered by date |
GetEmployeeAttribute(string)
Get employee attribute value
Declaration
public object GetEmployeeAttribute(string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName |
Returns
| Type | Description |
|---|---|
| object |
GetEmployeeAttribute<T>(string, T)
Get employee attribute typed value
Declaration
public T GetEmployeeAttribute<T>(string attributeName, T defaultValue = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | |
| T | defaultValue |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetFieldValue(string)
Get case filed value
Declaration
[ActionParameter("field", "The case field name", new string[] { "String" }, null, null)]
[PayrollAction("GetFieldValue", "Get case field value", new string[] { "Case" })]
public ActionValue GetFieldValue(string field)
Parameters
| Type | Name | Description |
|---|---|---|
| string | field | Object field name |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetFirstAvailableCaseValue(DatePeriod, IEnumerable<string>)
Get the first available case value within a time period
Declaration
public CasePayrollValue GetFirstAvailableCaseValue(DatePeriod period, IEnumerable<string> caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| DatePeriod | period | The value period |
| IEnumerable<string> | caseFieldNames | The name of the case fields to test |
Returns
| Type | Description |
|---|---|
| CasePayrollValue | The first available case value, otherwise null |
GetFirstAvailableCaseValue(IEnumerable<string>)
Get the first available case value from the current period
Declaration
public CasePayrollValue GetFirstAvailableCaseValue(IEnumerable<string> caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | caseFieldNames | The name of the case fields to test |
Returns
| Type | Description |
|---|---|
| CasePayrollValue | The first available case value, otherwise null |
GetFirstUnavailableCaseValue(DatePeriod, IEnumerable<string>)
Get the first unavailable case value within a time period
Declaration
public string GetFirstUnavailableCaseValue(DatePeriod period, IEnumerable<string> caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| DatePeriod | period | The value period |
| IEnumerable<string> | caseFieldNames | The name of the case fields to test |
Returns
| Type | Description |
|---|---|
| string | The case field name of the first unavailable case value, otherwise null |
GetFirstUnavailableCaseValue(IEnumerable<string>)
Get the first unavailable case value from the current period
Declaration
public string GetFirstUnavailableCaseValue(IEnumerable<string> caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | caseFieldNames | The name of the case fields to test |
Returns
| Type | Description |
|---|---|
| string | The case field name of the first unavailable case value, otherwise null |
GetFutureCyclePeriods(bool)
Get future cycle periods from the current period to the last cycle period
Declaration
public List<DatePeriod> GetFutureCyclePeriods(bool includeCurrent = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | includeCurrent | Include the current period |
Returns
| Type | Description |
|---|---|
| List<DatePeriod> | The future cycle periods ordered by date |
GetLookupProgressiveRanges(string, decimal)
Get progressive lookup range brackets
Declaration
public List<LookupRangeBracket> GetLookupProgressiveRanges(string lookupName, decimal rangeValue)
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<LookupRangeBracket> | Matching progressive brackets |
GetLookupRanges(string, decimal?)
Get payroll lookup range brackets
Declaration
public List<LookupRangeBracket> 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<LookupRangeBracket> | List of lookup range brackets |
GetLookupThresholdRange(string, decimal)
Get threshold lookup range bracket
Declaration
public LookupRangeBracket GetLookupThresholdRange(string lookupName, decimal rangeValue)
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 |
|---|---|
| LookupRangeBracket | Matching threshold bracket, null on missing range |
GetLookupValue(string, ActionValue, ActionValue, string)
Get lookup value by key and range value
Declaration
[ActionParameter("lookup", "The lookup name", new string[] { "String" }, null, null)]
[ActionParameter("key", "The lookup key", null, null, null)]
[ActionParameter("rangeValue", "The lookup key or range value", null, null, null)]
[ActionParameter("field", "The JSON value field name (optional)", null, null, null)]
[PayrollAction("GetLookupValue", "Get lookup value by key and value field name", new string[] { "Lookup" })]
public ActionValue GetLookupValue(string lookup, ActionValue key, ActionValue rangeValue, string field = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookup | |
| ActionValue | key | |
| ActionValue | rangeValue | |
| string | field |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetLookupValue(string, ActionValue, string)
Get lookup value by key or range value
Declaration
[ActionParameter("lookup", "The lookup name", new string[] { "String" }, null, null)]
[ActionParameter("keyOrRangeValue", "The lookup key or range value", null, null, null)]
[ActionParameter("field", "The JSON value field name (optional)", null, null, null)]
[PayrollAction("GetLookupValue", "Get lookup value by key or range value", new string[] { "Lookup" })]
public ActionValue GetLookupValue(string lookup, ActionValue keyOrRangeValue, string field = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookup | |
| ActionValue | keyOrRangeValue | |
| string | field |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetLookup<T>(string, object[], string)
Get lookup value with multiple keys
Declaration
public T GetLookup<T>(string lookupName, object[] lookupKeyValues, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | The lookup name |
| object[] | lookupKeyValues | The lookup key values (serialized to JSON string) |
| string | culture | The culture, null for the system culture (optional) |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetLookup<T>(string, string, string)
Returns the typed value stored in a lookup for the given key
Declaration
public T GetLookup<T>(string lookupName, string lookupKey, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | PascalCase name of the lookup |
| string | lookupKey | The exact key to look up |
| string | culture | Culture for value formatting; defaults to the system culture |
Returns
| Type | Description |
|---|---|
| T | The typed lookup value, or |
Type Parameters
| Name | Description |
|---|---|
| T | Expected value type; use |
Remarks
When the stored value is a JSON object and T is not string,
the JSON is deserialized automatically. Use GetObjectLookup<T>(string, string, string, string)
to extract a single property from a JSON-object lookup value.
GetMultiPeriodCaseValues(int, int, params string[])
Get multiple case values of multiple periods
Declaration
public MultiPeriodCasePayrollValueDictionary GetMultiPeriodCaseValues(int periodStartOffset, int periodEndOffset, params string[] caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| int | periodStartOffset | Offset of start period |
| int | periodEndOffset | Offset of end period |
| string[] | caseFieldNames | The case field names |
Returns
| Type | Description |
|---|---|
| MultiPeriodCasePayrollValueDictionary | Dictionary of multiple case values grouped by period |
GetObjectLookup<T>(string, string, string, string)
Get object lookup by range value
Declaration
public T GetObjectLookup<T>(string lookupName, string objectKey, string lookupKey = null, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | The lookup name |
| string | objectKey | The object key |
| string | lookupKey | The lookup key (optional) |
| string | culture | The culture, null for the system culture (optional) |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetPastCyclePeriods(bool)
Get past cycle periods from the first cycle period to the current period
Declaration
public List<DatePeriod> GetPastCyclePeriods(bool includeCurrent = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | includeCurrent | Include the current period |
Returns
| Type | Description |
|---|---|
| List<DatePeriod> | The past cycle periods ordered by date |
GetPeriod(DateTime, int)
Get period by moment
Declaration
public DatePeriod GetPeriod(DateTime moment, int offset = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | moment | The period moment |
| int | offset | The period offset: 0=current, -1=previous, 1=next |
Returns
| Type | Description |
|---|---|
| DatePeriod | The period including the moment |
GetPeriod(int)
Returns the payroll period at a given offset relative to the current evaluation period
Declaration
public DatePeriod GetPeriod(int offset = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | offset | Period offset: |
Returns
| Type | Description |
|---|---|
| DatePeriod | The DatePeriod for the requested offset |
Remarks
The period length (monthly, weekly, etc.) is determined by the payroll calendar. Use negative offsets to access past periods within the same cycle for YTD calculations. PreviousPeriod and NextPeriod are shorthand for offsets -1 and +1.
GetPeriodCaseValue(DatePeriod, string, string)
Get the case payroll value by case field name
Declaration
public CasePayrollValue GetPeriodCaseValue(DatePeriod period, string caseFieldName, string caseSlot = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DatePeriod | period | The value period |
| string | caseFieldName | The case field name |
| string | caseSlot | The case slot |
Returns
| Type | Description |
|---|---|
| CasePayrollValue | A case value from the period |
GetPeriodCaseValue(int, int, string, string)
Get case payroll value of multiple periods
Declaration
public PeriodCasePayrollValueDictionary GetPeriodCaseValue(int periodStartOffset, int periodEndOffset, string caseFieldName, string caseSlot = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | periodStartOffset | Offset of start period |
| int | periodEndOffset | Offset of end period |
| string | caseFieldName | The case field name |
| string | caseSlot | The case slot |
Returns
| Type | Description |
|---|---|
| PeriodCasePayrollValueDictionary | Dictionary of case values grouped by periods |
GetPeriodCaseValue(int, string, string)
Get case payroll value of an offset period
Declaration
public CasePayrollValue GetPeriodCaseValue(int periodOffset, string caseFieldName, string caseSlot = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | periodOffset | The offset period |
| string | caseFieldName | The case field name |
| string | caseSlot | The case slot |
Returns
| Type | Description |
|---|---|
| CasePayrollValue | A case value from the offset period |
GetPeriodCaseValue<T>(DatePeriod, string, string)
Returns the typed case field value active within a specific date period
Declaration
public T GetPeriodCaseValue<T>(DatePeriod period, string caseFieldName, string caseSlot = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DatePeriod | period | The date period to query |
| string | caseFieldName | PascalCase name of the case field |
| string | caseSlot | Optional slot name |
Returns
| Type | Description |
|---|---|
| T | The typed value, or |
Type Parameters
| Name | Description |
|---|---|
| T | The expected value type |
Remarks
Use GetPeriod(int) to build offset periods (e.g. GetPeriod(-1) for the
previous period). For the current period prefer GetCaseValue<T>(string, string).
GetPeriodCaseValue<T>(int, string, string)
Get case payroll typed value of an offset period
Declaration
public T GetPeriodCaseValue<T>(int periodOffset, string caseFieldName, string caseSlot = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | periodOffset | The offset period |
| string | caseFieldName | The case field name |
| string | caseSlot | The case slot |
Returns
| Type | Description |
|---|---|
| T | A case value from the offset period |
Type Parameters
| Name | Description |
|---|---|
| T |
GetPeriodCaseValues(DatePeriod, params string[])
Returns the values of multiple case fields active within a specific date period
Declaration
public CasePayrollValueDictionary GetPeriodCaseValues(DatePeriod period, params string[] caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| DatePeriod | period | The date period to query |
| string[] | caseFieldNames | One or more PascalCase case field names |
Returns
| Type | Description |
|---|---|
| CasePayrollValueDictionary | A dictionary keyed by case field name |
GetPeriodCaseValues(int, params string[])
Get multiple case values of an offset period
Declaration
public CasePayrollValueDictionary GetPeriodCaseValues(int periodOffset, params string[] caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| int | periodOffset | The offset period |
| string[] | caseFieldNames | The case field names |
Returns
| Type | Description |
|---|---|
| CasePayrollValueDictionary | Dictionary of case values grouped by case field name |
GetPeriodOffset(DateTime)
Get offset to period
Declaration
public int GetPeriodOffset(DateTime moment)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | moment | The period moment |
Returns
| Type | Description |
|---|---|
| int | The period offset |
GetPeriodRawCaseObjects<T>(List<DateTime>, bool)
Get case object from a date period
Declaration
public List<T> GetPeriodRawCaseObjects<T>(List<DateTime> moments, bool recursive = true) where T : class, ICaseObject, new()
Parameters
| Type | Name | Description |
|---|---|---|
| List<DateTime> | moments | Value moments |
| bool | recursive | Recursive objects (default: true) |
Returns
| Type | Description |
|---|---|
| List<T> | Data object with change data |
Type Parameters
| Name | Description |
|---|---|
| T |
GetPeriodRawCaseValues(string)
Get raw case values created within a date period
Declaration
public List<CaseValue> GetPeriodRawCaseValues(string caseFieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The case field name |
Returns
| Type | Description |
|---|---|
| List<CaseValue> | Raw case values from a date period |
Remarks
Case value tags and attributes are not supported
GetPeriodRawCaseValues(string, DatePeriod)
Get raw case values created within a date period
Declaration
public List<CaseValue> GetPeriodRawCaseValues(string caseFieldName, DatePeriod period)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The case field name |
| DatePeriod | period | The case value creation period |
Returns
| Type | Description |
|---|---|
| List<CaseValue> | Raw case values from a date period |
GetPeriodRawCaseValues(string, int)
Get raw case values created within an offset period
Declaration
public List<CaseValue> GetPeriodRawCaseValues(string caseFieldName, int periodOffset)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The case field name |
| int | periodOffset | The offset period |
Returns
| Type | Description |
|---|---|
| List<CaseValue> | Raw case values from an offset period |
GetPeriods(int, int)
Get periods by offset range
Declaration
public List<DatePeriod> GetPeriods(int startOffset, int endOffset)
Parameters
| Type | Name | Description |
|---|---|---|
| int | startOffset | The offset to the first period |
| int | endOffset | The offset to the last period |
Returns
| Type | Description |
|---|---|
| List<DatePeriod> | The periods ordered by date |
GetRangeLookup<T>(string, decimal, string, string)
Returns the typed value from a range lookup whose bracket contains the given value
Declaration
public T GetRangeLookup<T>(string lookupName, decimal rangeValue, string lookupKey = null, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | PascalCase name of the range lookup |
| decimal | rangeValue | The numeric value used to select the matching range bracket |
| string | lookupKey | Optional secondary key for keyed range lookups |
| string | culture | Culture for value formatting; defaults to the system culture |
Returns
| Type | Description |
|---|---|
| T | The typed lookup value for the matching bracket, or |
Type Parameters
| Name | Description |
|---|---|
| T | Expected value type |
Remarks
Range lookups are used for threshold tables (e.g. tax rates, AHV contribution rates).
The engine finds the bracket whose lower bound is ≤ rangeValue and returns its value.
For progressive tax calculations use ApplyRangeValue(string, decimal, string) instead.
GetRangeObjectLookup<T>(string, decimal, string, string, string)
Get object lookup by range value
Declaration
public T GetRangeObjectLookup<T>(string lookupName, decimal rangeValue, string objectKey, string lookupKey = null, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | The lookup name |
| decimal | rangeValue | The range value |
| string | objectKey | The object key |
| string | lookupKey | The lookup key (optional) |
| string | culture | The culture, null for the system culture (optional) |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetRawCaseObject<T>(DateTime, bool)
Get case object from a specific date
Declaration
public T GetRawCaseObject<T>(DateTime valueDate, bool recursive = true) where T : class, ICaseObject, new()
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | valueDate | Value date |
| bool | recursive | Recursive objects (default: true) |
Returns
| Type | Description |
|---|---|
| T | Data object with change data |
Type Parameters
| Name | Description |
|---|---|
| T |
GetRawCaseValue(string, DateTime)
Returns the raw CaseValue record that was active at an exact point in time
Declaration
public CaseValue GetRawCaseValue(string caseFieldName, DateTime valueDate)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | PascalCase name of the case field |
| DateTime | valueDate | The exact moment at which to read the value |
Returns
| Type | Description |
|---|---|
| CaseValue | The CaseValue record, or |
Remarks
Unlike GetCaseValue<T>(string, string), this method returns the full
database record including Created, Start, End, and Tags.
Use it for audit trails, retroactive corrections, or time-travel queries.
GetRawCaseValue<T>(string, DateTime)
Get raw payroll value from a specific date
Declaration
public T GetRawCaseValue<T>(string caseFieldName, DateTime valueDate)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The case field name |
| DateTime | valueDate | The value date |
Returns
| Type | Description |
|---|---|
| T | Raw case value from a specific date |
Type Parameters
| Name | Description |
|---|---|
| T |
GetRawCaseValues(IList<string>, DateTime)
Get multiple raw case values from a specific date
Declaration
public List<CaseValue> GetRawCaseValues(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<CaseValue> | Raw case value from a specific date |
GetRawCaseValues(string, DateTime?, DateTime?)
Get raw case values created within the current period
Declaration
public List<CaseValue> GetRawCaseValues(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<CaseValue> | Raw case values from the current period |
GetSlotByValue(string, string, string)
Get slot name by value
Declaration
public string GetSlotByValue(string caseFieldName, string value, string prefix = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The name of the case field |
| string | value | The slot value |
| string | prefix | The slot prefix |
Returns
| Type | Description |
|---|---|
| string | The slot name matching the value and prefix, otherwise null |
GetSlotValues(string)
Get the case slot values, grouped by slot name
Declaration
public Dictionary<string, CasePayrollValue> GetSlotValues(string caseFieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The name of the case field |
Returns
| Type | Description |
|---|---|
| Dictionary<string, CasePayrollValue> | The case values in a dictionary grouped by slot name |
GetSlotValues<T>(string)
Get the typed case slot values, grouped by slot name
Declaration
public Dictionary<string, T> GetSlotValues<T>(string caseFieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | The name of the case field |
Returns
| Type | Description |
|---|---|
| Dictionary<string, T> | The case values in a dictionary grouped by slot name |
Type Parameters
| Name | Description |
|---|---|
| T |
GetTimeSpan(ActionValue, ActionValue)
Get the timespan between two dates
Declaration
[ActionParameter("start", "The start date", new string[] { "Date" }, null, null)]
[ActionParameter("end", "The end date", new string[] { "Date" }, null, null)]
[PayrollAction("GetTimeSpan", "Get the timespan between two dates", new string[] { "Date" })]
public ActionValue GetTimeSpan(ActionValue start, ActionValue end)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | start | |
| ActionValue | end |
Returns
| Type | Description |
|---|---|
| ActionValue | Timespan between the dates or none |
HasCaseFieldAttribute(string, string)
Test for existing case field attribute
Declaration
public bool HasCaseFieldAttribute(string caseFieldName, string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | Name of the case field |
| string | attributeName | The attribute name |
Returns
| Type | Description |
|---|---|
| bool |
HasCaseValueAttribute(string, string)
Test for existing case field value attribute
Declaration
public bool HasCaseValueAttribute(string caseFieldName, string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caseFieldName | Name of the case field |
| string | attributeName | The attribute name |
Returns
| Type | Description |
|---|---|
| bool |
HasFieldValue(string)
Test for case field value
Declaration
[ActionParameter("field", "The case field name", new string[] { "String" }, null, null)]
[PayrollAction("HasFieldValue", "Test for case field value", new string[] { "Case" })]
public bool HasFieldValue(string field)
Parameters
| Type | Name | Description |
|---|---|---|
| string | field | Object field name |
Returns
| Type | Description |
|---|---|
| bool | True if field exists |
HasLookup(string)
Tests whether a lookup with the given name exists in the current payroll context
Declaration
public bool HasLookup(string lookupName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookupName | PascalCase name of the lookup |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Use this as a guard before GetLookup<T>(string, string, string) when the lookup is optional or may not yet be deployed in a regulation.
HasLookupValue(string, ActionValue, ActionValue, string)
Test for lookup value by key and range value
Declaration
[ActionParameter("lookup", "The lookup name", new string[] { "String" }, null, null)]
[ActionParameter("key", "The lookup key", new string[] { "String" }, null, null)]
[ActionParameter("field", "The JSON value field name (optional)", null, null, null)]
[PayrollAction("HasLookupValue", "Test for lookup value by key and range value", new string[] { "Lookup" })]
public bool HasLookupValue(string lookup, ActionValue key, ActionValue rangeValue, string field = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookup | |
| ActionValue | key | |
| ActionValue | rangeValue | |
| string | field |
Returns
| Type | Description |
|---|---|
| bool |
HasLookupValue(string, ActionValue, string)
Test for lookup value by key or range value
Declaration
[ActionParameter("lookup", "The lookup name", new string[] { "String" }, null, null)]
[ActionParameter("keyOrRangeValue", "The lookup key or range value", null, null, null)]
[ActionParameter("field", "The JSON value field name (optional)", null, null, null)]
[PayrollAction("HasLookupValue", "Test for lookup value by key", new string[] { "Lookup" })]
public bool HasLookupValue(string lookup, ActionValue keyOrRangeValue, string field = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lookup | |
| ActionValue | keyOrRangeValue | |
| string | field |
Returns
| Type | Description |
|---|---|
| bool |
IIf(bool, ActionValue, ActionValue)
Returns one of two values, depending on the evaluation of an expression
Declaration
[ActionParameter("expression", "Expression to evaluate", null, null, null)]
[ActionParameter("onTrue", "Value or expression returned if expr is True", null, null, null)]
[ActionParameter("onFalse", "Value or expression returned if expr is False", null, null, null)]
[PayrollAction("IIf", "Returns one of two parts, depending on the evaluation of an expression", new string[] { "System" })]
public ActionValue IIf(bool expression, ActionValue onTrue, ActionValue onFalse)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | expression | |
| ActionValue | onTrue | |
| ActionValue | onFalse |
Returns
| Type | Description |
|---|---|
| ActionValue |
IfNull(ActionValue, ActionValue)
Returns the second value in case the first value is null
Declaration
[ActionParameter("first", "Value to return if defined", null, null, null)]
[ActionParameter("second", "Value to return if first value is undefined", null, null, null)]
[PayrollAction("IfNull", "Returns the second value in case the first value is null", new string[] { "System" })]
public ActionValue IfNull(ActionValue first, ActionValue second)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | first | |
| ActionValue | second |
Returns
| Type | Description |
|---|---|
| ActionValue |
IsFirstCycleDay(DateTime)
Test if a date is the first cycle day
Declaration
public bool IsFirstCycleDay(DateTime moment)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | moment | The cycle moment |
Returns
| Type | Description |
|---|---|
| bool | True for the first cycle day |
IsFirstPeriodDay(DateTime)
Test if a date is the first period day
Declaration
public bool IsFirstPeriodDay(DateTime moment)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | moment | The period moment |
Returns
| Type | Description |
|---|---|
| bool | True for the first period day |
IsLastCycleDay(DateTime)
Test if a date is the last cycle day
Declaration
public bool IsLastCycleDay(DateTime moment)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | moment | The cycle moment |
Returns
| Type | Description |
|---|---|
| bool | True for the last cycle day |
IsLastPeriodDay(DateTime)
Test if a date is the last period day
Declaration
public bool IsLastPeriodDay(DateTime moment)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | moment | The period moment |
Returns
| Type | Description |
|---|---|
| bool | True for the last period day |
IsNotNull(ActionValue)
Returns true whether the value is not Null
Declaration
[ActionParameter("value", "Value to test", null, null, null)]
[PayrollAction("IsNotNull", "Returns true whether the value is not Null", new string[] { "System" })]
public ActionValue IsNotNull(ActionValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | value |
Returns
| Type | Description |
|---|---|
| ActionValue |
IsNull(ActionValue)
Returns true whether the value is Null
Declaration
[ActionParameter("value", "Value to test", null, null, null)]
[PayrollAction("IsNull", "Returns true whether the value is Null", new string[] { "System" })]
public ActionValue IsNull(ActionValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | value |
Returns
| Type | Description |
|---|---|
| ActionValue |
Log(string, LogLevel)
Log a message
Declaration
[ActionParameter("message", "Message to log", null, null, null)]
[ActionParameter("level", "Log level (default: Information)", null, null, null)]
[PayrollAction("Log", "Log a message", new string[] { "System" })]
public void Log(string message, LogLevel level = LogLevel.Information)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | |
| LogLevel | level |
Max(ActionValue, ActionValue)
Get the maximum value
Declaration
[ActionParameter("left", "The left compare value", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[ActionParameter("right", "The right compare value", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[PayrollAction("Max", "Get the maximum value", new string[] { "Math" })]
public ActionValue Max(ActionValue left, ActionValue right)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | left | Left value |
| ActionValue | right | Right value |
Returns
| Type | Description |
|---|---|
| ActionValue |
Max(params ActionValue[])
Get largest value of collection
Declaration
[ActionParameter("values", "Value collection", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[PayrollAction("Max", "Get the largest collection value", new string[] { "Math" })]
public ActionValue Max(params ActionValue[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue[] | values | Value collection |
Returns
| Type | Description |
|---|---|
| ActionValue |
Min(ActionValue, ActionValue)
Get the minimum value
Declaration
[ActionParameter("left", "The left compare value", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[ActionParameter("right", "The right compare value", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[PayrollAction("Min", "Get the minimum value", new string[] { "Math" })]
public ActionValue Min(ActionValue left, ActionValue right)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | left | Left value |
| ActionValue | right | Right value |
Returns
| Type | Description |
|---|---|
| ActionValue |
Min(params ActionValue[])
Get the smallest collection value
Declaration
[ActionParameter("values", "Value collection", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[PayrollAction("Min", "Get the smallest collection value", new string[] { "Math" })]
public ActionValue Min(params ActionValue[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue[] | values | Value collection |
Returns
| Type | Description |
|---|---|
| ActionValue |
PastPeriod()
Get period before the evaluation date
Declaration
public DatePeriod PastPeriod()
Returns
| Type | Description |
|---|---|
| DatePeriod | Period from the minimal date until the evaluation date |
Range(ActionValue, ActionValue, ActionValue)
Ensure value is within a value range
Declaration
[ActionParameter("value", "The value to limit", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[ActionParameter("min", "The minimum value", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[ActionParameter("max", "The maximum value", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[PayrollAction("Range", "Ensure value is within a value range", new string[] { "Math" })]
public ActionValue Range(ActionValue value, ActionValue min, ActionValue max)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | value | The value to limit |
| ActionValue | min | Left value |
| ActionValue | max | Right value |
Returns
| Type | Description |
|---|---|
| ActionValue |
SameDay(ActionValue, ActionValue)
Test for same date day
Declaration
[ActionParameter("left", "The left date to compare", new string[] { "Date" }, null, null)]
[ActionParameter("right", "The right date to compare", new string[] { "Date" }, null, null)]
[PayrollAction("SameDay", "Test for same date day", new string[] { "Date" })]
public ActionValue SameDay(ActionValue left, ActionValue right)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | left | |
| ActionValue | right |
Returns
| Type | Description |
|---|---|
| ActionValue | True, if year, month and day are equals |
SameMonth(ActionValue, ActionValue)
Test for same date month
Declaration
[ActionParameter("left", "The left date to compare", new string[] { "Date" }, null, null)]
[ActionParameter("right", "The right date to compare", new string[] { "Date" }, null, null)]
[PayrollAction("SameMonth", "Test for same date month", new string[] { "Date" })]
public ActionValue SameMonth(ActionValue left, ActionValue right)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | left | |
| ActionValue | right |
Returns
| Type | Description |
|---|---|
| ActionValue | True, if year and month are equals |
SameYear(ActionValue, ActionValue)
Test for same date year
Declaration
[ActionParameter("left", "The left date to compare", new string[] { "Date" }, null, null)]
[ActionParameter("right", "The right date to compare", new string[] { "Date" }, null, null)]
[PayrollAction("SameYear", "Test for same date year", new string[] { "Date" })]
public ActionValue SameYear(ActionValue left, ActionValue right)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | left | |
| ActionValue | right |
Returns
| Type | Description |
|---|---|
| ActionValue | True, if year are equals |
SetNamespace(string, string)
Set namespace to a name
Declaration
[ActionParameter("name", "Name to be extended", null, null, null)]
[ActionParameter("namespace", "Namespace to apply (default: regulation namespace)", null, null, null)]
[PayrollAction("SetNamespace", "Set namespace to a name", new string[] { "System" })]
public string SetNamespace(string name, string @namespace = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | |
| string | namespace |
Returns
| Type | Description |
|---|---|
| string |
TestAvailableCaseValues(DatePeriod, IEnumerable<string>)
Test for available cases
Declaration
public bool TestAvailableCaseValues(DatePeriod period, IEnumerable<string> caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| DatePeriod | period | The value period |
| IEnumerable<string> | caseFieldNames | The name of the case fields to test |
Returns
| Type | Description |
|---|---|
| bool | True if all case values are available |
TestAvailableCaseValues(IEnumerable<string>)
Test for available cases from the current period
Declaration
public bool TestAvailableCaseValues(IEnumerable<string> caseFieldNames)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | caseFieldNames | The name of the case fields to test |
Returns
| Type | Description |
|---|---|
| bool | True if all case values are available |
Within(ActionValue, ActionValue, ActionValue)
Test value is within a value range
Declaration
[ActionParameter("value", "The value to test", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[ActionParameter("min", "The minimum value", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[ActionParameter("max", "The maximum value", new string[] { "Num", "Date", "TimeSpan" }, null, null)]
[PayrollAction("Within", "Test value is within a value range", new string[] { "Math" })]
public ActionValue Within(ActionValue value, ActionValue min, ActionValue max)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | value | The value to test |
| ActionValue | min | Left value |
| ActionValue | max | Right value |
Returns
| Type | Description |
|---|---|
| ActionValue |
YearDiff(ActionValue, ActionValue)
Get years between two dates
Declaration
[ActionParameter("start", "The start date", new string[] { "Date" }, null, null)]
[ActionParameter("end", "The end date", new string[] { "Date" }, null, null)]
[PayrollAction("YearDiff", "Test for same date year", new string[] { "Date" })]
public ActionValue YearDiff(ActionValue start, ActionValue end)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionValue | start | |
| ActionValue | end |
Returns
| Type | Description |
|---|---|
| ActionValue | The year (int) od dates, otherwise none |