Show / Hide Table of Contents

Class WageTypeValueFunction

Wage type function

Inheritance
object
Function
PayrollFunction
PayrunFunction
WageTypeFunction
WageTypeValueFunction
Implements
IDisposable
Inherited Members
WageTypeFunction.GetWageTypeValueByNumber(decimal)
WageTypeFunction.GetWageTypeValueByName(string)
WageTypeFunction.GetCollectorValue(string)
WageTypeFunction.GetWageType(decimal)
WageTypeFunction.GetWageType(string)
WageTypeFunction.GetCollector(string)
WageTypeFunction.EnableCollector(string)
WageTypeFunction.DisableCollector(string)
WageTypeFunction.GetResultTags()
WageTypeFunction.SetResultTags(IEnumerable<string>)
WageTypeFunction.GetResultAttribute(string)
WageTypeFunction.GetResultAttribute<T>(string, T)
WageTypeFunction.SetResultAttribute(string, object)
WageTypeFunction.GetWageTypeAttribute(string)
WageTypeFunction.GetWageTypeAttribute<T>(string, T)
WageTypeFunction.GetCollectorCurrentConsolidatedValue(CollectorConsolidatedResultQuery)
WageTypeFunction.GetWageTypeCurrentConsolidatedValue(WageTypeConsolidatedResultQuery)
WageTypeFunction.AddCustomResult(string, IEnumerable<string>, Dictionary<string, object>, ValueType?, string)
WageTypeFunction.AddCustomResult(string, decimal, IEnumerable<string>, Dictionary<string, object>, ValueType?, string)
WageTypeFunction.AddCustomResult(string, DateTime, DateTime, IEnumerable<string>, Dictionary<string, object>, ValueType?, string)
WageTypeFunction.AddCustomResult(string, decimal, DateTime, DateTime, IEnumerable<string>, Dictionary<string, object>, ValueType?, string)
WageTypeFunction.ScheduleRetroPayrun(DateTime, IEnumerable<string>)
WageTypeFunction.Attribute
WageTypeFunction.AttributePayrollValue
WageTypeFunction.WageType
WageTypeFunction.Collector
WageTypeFunction.WageTypeNumber
WageTypeFunction.WageTypeName
WageTypeFunction.WageTypeDescription
WageTypeFunction.WageTypeCalendar
WageTypeFunction.Collectors
WageTypeFunction.CollectorGroups
PayrunFunction.GetCycleWageTypeValue(decimal)
PayrunFunction.GetCycleWageTypeValue(string)
PayrunFunction.GetRetroWageTypeValueSumByNumber(decimal)
PayrunFunction.GetRetroWageTypeValueSumByName(string)
PayrunFunction.GetCycleCollectorValue(string)
PayrunFunction.GetRuntimeValue(string)
PayrunFunction.SetRuntimeValue(string, object)
PayrunFunction.RemoveRuntimeValue(string)
PayrunFunction.GetPayrunResultValue(string)
PayrunFunction.SetPayrunResultValue(string, object, string)
PayrunFunction.GetPayrunJobAttribute(string)
PayrunFunction.GetPayrunJobAttribute<T>(string, T)
PayrunFunction.SetPayrunJobAttribute(string, object)
PayrunFunction.RemovePayrunJobAttribute(string)
PayrunFunction.HasPayrunRuntimeValue(string)
PayrunFunction.GetPayrunRuntimeValue(string)
PayrunFunction.GetPayrunRuntimeValue<T>(string)
PayrunFunction.SetPayrunRuntimeValue(string, string)
PayrunFunction.SetPayrunRuntimeValue<T>(string, T)
PayrunFunction.HasEmployeeRuntimeValue(string)
PayrunFunction.GetEmployeeRuntimeValue(string)
PayrunFunction.GetEmployeeRuntimeValue<T>(string)
PayrunFunction.SetEmployeeRuntimeValue(string, string)
PayrunFunction.SetEmployeeRuntimeValue<T>(string, T)
PayrunFunction.GetPayrunResult(string)
PayrunFunction.GetPayrunResult<T>(string, T)
PayrunFunction.SetPayrunResult(string, object, ValueType?, string, IEnumerable<string>, Dictionary<string, object>, string)
PayrunFunction.SetPayrunResult(string, object, DateTime, DateTime, ValueType?, string, IEnumerable<string>, Dictionary<string, object>, string)
PayrunFunction.GetWageTypeNumber(string)
PayrunFunction.GetWageTypeName(decimal)
PayrunFunction.GetWageTypeCycleResults(WageTypeCycleResultQuery)
PayrunFunction.GetPeriodWageTypeResults(WageTypePeriodResultQuery)
PayrunFunction.GetWageTypeResults(WageTypeRangeResultQuery)
PayrunFunction.GetWageTypeResults(IEnumerable<decimal>, DateTime, DateTime, string, PayrunJobStatus?, IEnumerable<string>)
PayrunFunction.GetConsolidatedWageTypeResults(WageTypeConsolidatedResultQuery)
PayrunFunction.GetWageTypeCustomResults(WageTypeRangeResultQuery)
PayrunFunction.GetConsolidatedWageTypeCustomResults(WageTypeConsolidatedResultQuery)
PayrunFunction.GetWageTypeRetroResults(WageTypeResultQuery)
PayrunFunction.GetWageTypeRetroResultSum(decimal)
PayrunFunction.GetRetroWageTypeValueSum(decimal)
PayrunFunction.GetRetroWageTypeValueSum(string)
PayrunFunction.GetCollectorCycleResults(CollectorCycleResultQuery)
PayrunFunction.GetCollectorPeriodResults(CollectorPeriodResultQuery)
PayrunFunction.GetCollectorResults(CollectorRangeResultQuery)
PayrunFunction.GetCollectorResults(IEnumerable<string>, DateTime, DateTime, string, PayrunJobStatus?, IEnumerable<string>)
PayrunFunction.GetConsolidatedCollectorResults(CollectorConsolidatedResultQuery)
PayrunFunction.GetConsolidatedCollectorCustomResults(CollectorConsolidatedResultQuery)
PayrunFunction.PayrunId
PayrunFunction.PayrunName
PayrunFunction.PreviewJob
PayrunFunction.ExecutionPhase
PayrunFunction.RetroPeriod
PayrunFunction.IsRetroPayrun
PayrunFunction.IsCycleRetroPayrun
PayrunFunction.Forecast
PayrunFunction.IsForecast
PayrunFunction.CycleName
PayrunFunction.PeriodName
PayrollFunction.StringType
PayrollFunction.IntType
PayrollFunction.NumericType
PayrollFunction.DecimalType
PayrollFunction.DateType
PayrollFunction.TimeSpanType
PayrollFunction.BooleanType
PayrollFunction.HasFieldValue(string)
PayrollFunction.GetFieldValue(string)
PayrollFunction.HasLookupValue(string, ActionValue, string)
PayrollFunction.HasLookupValue(string, ActionValue, ActionValue, string)
PayrollFunction.GetLookupValue(string, ActionValue, string)
PayrollFunction.GetLookupValue(string, ActionValue, ActionValue, string)
PayrollFunction.ApplyRangeLookupValue(string, decimal, string)
PayrollFunction.Min(params ActionValue[])
PayrollFunction.Min(ActionValue, ActionValue)
PayrollFunction.Max(params ActionValue[])
PayrollFunction.Max(ActionValue, ActionValue)
PayrollFunction.Within(ActionValue, ActionValue, ActionValue)
PayrollFunction.Range(ActionValue, ActionValue, ActionValue)
PayrollFunction.Concat(params ActionValue[])
PayrollFunction.Contains(ActionValue, params ActionValue[])
PayrollFunction.GetTimeSpan(ActionValue, ActionValue)
PayrollFunction.SameYear(ActionValue, ActionValue)
PayrollFunction.SameMonth(ActionValue, ActionValue)
PayrollFunction.SameDay(ActionValue, ActionValue)
PayrollFunction.YearDiff(ActionValue, ActionValue)
PayrollFunction.Age(ActionValue, ActionValue)
PayrollFunction.IsNull(ActionValue)
PayrollFunction.IsNotNull(ActionValue)
PayrollFunction.IfNull(ActionValue, ActionValue)
PayrollFunction.IIf(bool, ActionValue, ActionValue)
PayrollFunction.SetNamespace(string, string)
PayrollFunction.Log(string, LogLevel)
PayrollFunction.GetCalendarPeriod(DateTime?, int)
PayrollFunction.GetCalendarDayCount(string)
PayrollFunction.GetEmployeeAttribute(string)
PayrollFunction.GetEmployeeAttribute<T>(string, T)
PayrollFunction.GetCycle(int)
PayrollFunction.GetCycle(DateTime, int)
PayrollFunction.GetPeriods(int, int)
PayrollFunction.GetCyclePeriods()
PayrollFunction.GetPastCyclePeriods(bool)
PayrollFunction.GetFutureCyclePeriods(bool)
PayrollFunction.IsFirstCycleDay(DateTime)
PayrollFunction.IsLastCycleDay(DateTime)
PayrollFunction.PastPeriod()
PayrollFunction.FuturePeriod()
PayrollFunction.GetPeriod(int)
PayrollFunction.GetPeriod(DateTime, int)
PayrollFunction.GetPeriodOffset(DateTime)
PayrollFunction.IsFirstPeriodDay(DateTime)
PayrollFunction.IsLastPeriodDay(DateTime)
PayrollFunction.GetCaseValueType(string)
PayrollFunction.HasCaseFieldAttribute(string, string)
PayrollFunction.GetCaseFieldAttribute(string, string)
PayrollFunction.GetCaseFieldAttribute<T>(string, string, T)
PayrollFunction.HasCaseValueAttribute(string, string)
PayrollFunction.GetCaseValueAttribute(string, string)
PayrollFunction.GetCaseValueAttribute<T>(string, string, T)
PayrollFunction.TestAvailableCaseValues(IEnumerable<string>)
PayrollFunction.TestAvailableCaseValues(DatePeriod, IEnumerable<string>)
PayrollFunction.GetFirstAvailableCaseValue(IEnumerable<string>)
PayrollFunction.GetFirstAvailableCaseValue(DatePeriod, IEnumerable<string>)
PayrollFunction.GetFirstUnavailableCaseValue(IEnumerable<string>)
PayrollFunction.GetFirstUnavailableCaseValue(DatePeriod, IEnumerable<string>)
PayrollFunction.CaseFieldSlot(string, string)
PayrollFunction.GetPeriodCaseValue<T>(DatePeriod, string, string)
PayrollFunction.GetPeriodCaseValue(DatePeriod, string, string)
PayrollFunction.GetPeriodCaseValues(DatePeriod, params string[])
PayrollFunction.GetPeriodCaseValues(int, params string[])
PayrollFunction.GetPeriodCaseValue<T>(int, string, string)
PayrollFunction.GetPeriodCaseValue(int, string, string)
PayrollFunction.GetCaseValue<T>(string, string)
PayrollFunction.GetCaseValue(string, string)
PayrollFunction.GetPeriodCaseValue(int, int, string, string)
PayrollFunction.GetMultiPeriodCaseValues(int, int, params string[])
PayrollFunction.GetRawCaseValue(string, DateTime)
PayrollFunction.GetRawCaseValues(IList<string>, DateTime)
PayrollFunction.GetRawCaseValue<T>(string, DateTime)
PayrollFunction.GetPeriodRawCaseValues(string, DatePeriod)
PayrollFunction.GetPeriodRawCaseValues(string)
PayrollFunction.GetPeriodRawCaseValues(string, int)
PayrollFunction.GetRawCaseValues(string, DateTime?, DateTime?)
PayrollFunction.GetCaseObjectValues<T>(bool, bool)
PayrollFunction.GetCaseObject<T>(List<CasePayrollValue>, DateTime)
PayrollFunction.GetRawCaseObject<T>(DateTime, bool)
PayrollFunction.GetPeriodRawCaseObjects<T>(List<DateTime>, bool)
PayrollFunction.GetCaseValues(params string[])
PayrollFunction.GetCaseValueTags(string)
PayrollFunction.GetCaseValueTags(string, DateTime)
PayrollFunction.GetCaseValueSlots(string)
PayrollFunction.GetSlotValues(string)
PayrollFunction.GetSlotValues<T>(string)
PayrollFunction.GetSlotByValue(string, string, string)
PayrollFunction.HasLookup(string)
PayrollFunction.GetLookup<T>(string, string, string)
PayrollFunction.GetLookup<T>(string, object[], string)
PayrollFunction.GetObjectLookup<T>(string, string, string, string)
PayrollFunction.GetLookupRanges(string, decimal?)
PayrollFunction.GetLookupThresholdRange(string, decimal)
PayrollFunction.GetLookupProgressiveRanges(string, decimal)
PayrollFunction.GetRangeLookup<T>(string, decimal, string, string)
PayrollFunction.GetRangeObjectLookup<T>(string, decimal, string, string, string)
PayrollFunction.ApplyRangeValue(string, decimal, string)
PayrollFunction.GetAttributeIssue(string, params object[])
PayrollFunction.None
PayrollFunction.Null
PayrollFunction.PayrollId
PayrollFunction.Namespace
PayrollFunction.HasNamespace
PayrollFunction.DivisionId
PayrollFunction.PayrollCulture
PayrollFunction.EmployeeId
PayrollFunction.EmployeeIdentifier
PayrollFunction.CycleStart
PayrollFunction.CycleStartYear
PayrollFunction.CycleStartMonth
PayrollFunction.CycleStartDay
PayrollFunction.CycleEnd
PayrollFunction.CycleEndYear
PayrollFunction.CycleEndMonth
PayrollFunction.CycleEndDay
PayrollFunction.CycleDuration
PayrollFunction.Cycle
PayrollFunction.CycleDays
PayrollFunction.PreviousCycle
PayrollFunction.NextCycle
PayrollFunction.EvaluationDate
PayrollFunction.EvaluationPeriod
PayrollFunction.Periods
PayrollFunction.PeriodStart
PayrollFunction.PeriodStartYear
PayrollFunction.PeriodStartMonth
PayrollFunction.PeriodStartDay
PayrollFunction.PeriodEnd
PayrollFunction.PeriodEndYear
PayrollFunction.PeriodEndMonth
PayrollFunction.PeriodEndDay
PayrollFunction.PeriodDuration
PayrollFunction.Period
PayrollFunction.PeriodDays
PayrollFunction.PreviousPeriod
PayrollFunction.NextPeriod
PayrollFunction.FirstCyclePeriod
PayrollFunction.LastCyclePeriod
PayrollFunction.CycleStartOffset
PayrollFunction.CycleEndOffset
PayrollFunction.PastCyclePeriods
PayrollFunction.FutureCyclePeriods
PayrollFunction.PeriodsInCycle
PayrollFunction.CaseValue
PayrollFunction.CaseValueTags
Function.GetTenantAttribute(string)
Function.GetTenantAttribute<T>(string, T)
Function.GetUserAttribute(string)
Function.GetUserAttribute<T>(string, T)
Function.GetDerivedCulture(int, int)
Function.GetDerivedCalendar(int, int)
Function.GetCalendarDayCount(DateTime, DateTime, string)
Function.GetCalendarDayCount(string, DateTime, DateTime, string)
Function.IsCalendarWorkDay(string, DateTime?)
Function.IsCalendarWorkDay(DateTime?)
Function.GetPreviousWorkDay(string, DateTime?)
Function.GetPreviousWorkDays(string, DateTime?, int)
Function.GetNextWorkDay(string, DateTime?)
Function.GetNextWorkDays(string, DateTime?, int)
Function.GetCalendarPeriod(DateTime?, int, int, int)
Function.GetCalendarPeriod(string, DateTime?, int, string)
Function.LogVerbose(string, string, string)
Function.LogDebug(string, string, string)
Function.LogInformation(string, string, string)
Function.LogWarning(string, string, string)
Function.LogError(string, string, string)
Function.LogError(Exception, string, string)
Function.LogFatal(string, string, string)
Function.LogFatal(Exception, string, string)
Function.Log(LogLevel, string, string, string)
Function.AddTask(string, string, DateTime, string, Dictionary<string, object>)
Function.InvokeWebhook<T>(string, object)
Function.GetSourceFileName(string)
Function.ChangeValueType<T>(object, T, IFormatProvider)
Function.Dispose()
Function.Runtime
Function.TenantId
Function.TenantIdentifier
Function.UserId
Function.UserIdentifier
Function.UserCulture
Function.UserType
Function.SelfServiceUser
Function.AdminUser
Function.SourceFileName
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: PayrollEngine.Client.Scripting.Function
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public class WageTypeValueFunction : WageTypeFunction, IDisposable
Remarks

This is the core calculation function of the payrun. It runs once per wage type per employee (or multiple times if RestartExecution() is called). The returned value becomes the wage type result and is fed to all collectors that reference this wage type.

Available data sources within this function:

  • Employee case values via Employee["FieldName"] or GetCaseValue<T>(string, string).
  • Running collector values via Collector indexer.
  • Values from other wage types already calculated via WageType indexer.
  • Lookup tables via GetLookup<T>(string, string, string) and GetRangeLookup<T>(string, decimal, string, string).
  • Historical wage type results via GetWageTypeResults(WageTypeRangeResultQuery) or GetConsolidatedWageTypeResults(WageTypeConsolidatedResultQuery).

Return value: Return a decimal value to set the wage type result. Return null to produce no result for this wage type (no result stored, no collector fed). Return Empty to commit an explicit zero with metadata.

Custom results: Use AddCustomResult(string, decimal, IEnumerable<string>, Dictionary<string, object>, ValueType?, string) to attach supplementary breakdown results (e.g. per cost-centre amounts) alongside the primary result.

Retro runs: Use ScheduleRetroPayrun(DateTime, IEnumerable<string>) to trigger a retrospective correction payrun for a prior period.

Low-Code / No-Code: The wage type value can be derived entirely through action expressions using WageTypeValueAction attributes — no C# scripting required. The GetValue() entry point invokes all registered actions before executing any inline script body.

Examples
// Simple: return a case value as the wage type result
Employee["Salary"]
// Conditional: only return if a prerequisite wage type is positive
(decimal)WageType[2300] > 0 ? Employee["Bonus"] : PayrollValue.Empty
// Lookup-driven calculation
(decimal)Employee["Salary"] * GetLookup<decimal>("SocialRates", "Standard")
// With a custom breakdown result per cost centre
var total = (decimal)Employee["Salary"];
AddCustomResult("CostCenter1", total * 0.6m);
AddCustomResult("CostCenter2", total * 0.4m);
return total;
// Average of the last 3 completed periods
GetWageTypeResults(WageTypeNumber,
    new WageTypePeriodResultQuery(3, PayrunJobStatus.Complete))
    .DefaultIfEmpty().Average()

Constructors

View Source

WageTypeValueFunction(object)

Initializes a new instance with the function runtime

Declaration
public WageTypeValueFunction(object runtime)
Parameters
Type Name Description
object runtime

The runtime

View Source

WageTypeValueFunction(string)

New function instance without runtime (scripting development)

Declaration
protected WageTypeValueFunction(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 Source

ExecutionCount

The execution count

Declaration
[ActionProperty("Wage type value execution count", null)]
public int ExecutionCount { get; }
Property Value
Type Description
int

Methods

View Source

GetValue()

Entry point for the runtime

Declaration
public object GetValue()
Returns
Type Description
object
Remarks

Internal usage only, do not call this method

View Source

RestartExecution()

Restart execution of wage type calculation

Declaration
public void RestartExecution()

Implements

IDisposable

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)

See Also

WageTypeResultFunction
PayrunWageTypeAvailableFunction
  • View Source
☀
☾
Back to top Generated by DocFX