Class PayrunFunction
Payrun function
Inheritance
Implements
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Function
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public abstract class PayrunFunction : PayrollFunction, IDisposable
Constructors
PayrunFunction(object)
Initializes a new instance with the function runtime
Declaration
protected PayrunFunction(object runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| object | runtime | The runtime |
PayrunFunction(string)
New function instance without runtime (scripting development)
Declaration
protected PayrunFunction(string sourceFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sourceFileName | The name of the source file |
Properties
CycleName
The cycle name
Declaration
[ActionProperty("Cycle name", null)]
public string CycleName { get; }
Property Value
| Type | Description |
|---|---|
| string |
ExecutionPhase
The payrun execution phase
Declaration
public PayrunExecutionPhase ExecutionPhase { get; }
Property Value
| Type | Description |
|---|---|
| PayrunExecutionPhase |
Forecast
Forecast name
Declaration
[ActionProperty("Forecast name", null)]
public string Forecast { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsCycleRetroPayrun
True for a retro payrun within the current cycle
Declaration
[ActionProperty("Test for cycle retro payrun", null)]
public bool IsCycleRetroPayrun { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsForecast
True for a forecast payrun
Declaration
[ActionProperty("Test for forecast", null)]
public bool IsForecast { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsRetroPayrun
True for a retro payrun
Declaration
[ActionProperty("Test for retro payrun", null)]
public bool IsRetroPayrun { get; }
Property Value
| Type | Description |
|---|---|
| bool |
PayrunId
The payrun id
Declaration
public int PayrunId { get; }
Property Value
| Type | Description |
|---|---|
| int |
PayrunName
The payrun name
Declaration
[ActionProperty("Payrun name", null)]
public string PayrunName { get; }
Property Value
| Type | Description |
|---|---|
| string |
PeriodName
The period name
Declaration
[ActionProperty("Period name", null)]
public string PeriodName { get; }
Property Value
| Type | Description |
|---|---|
| string |
PreviewJob
Test for preview payrun job
Declaration
public bool PreviewJob { get; }
Property Value
| Type | Description |
|---|---|
| bool |
RetroPeriod
The retro payrun period
Declaration
public DatePeriod RetroPeriod { get; }
Property Value
| Type | Description |
|---|---|
| DatePeriod |
Methods
GetCollectorCycleResults(CollectorCycleResultQuery)
Get employee collector results by query
Declaration
public IList<CollectorResult> GetCollectorCycleResults(CollectorCycleResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectorCycleResultQuery | query | The cycle query |
Returns
| Type | Description |
|---|---|
| IList<CollectorResult> | Employee collector cycle results |
GetCollectorPeriodResults(CollectorPeriodResultQuery)
Get employee collector results by query
Declaration
public IList<CollectorResult> GetCollectorPeriodResults(CollectorPeriodResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectorPeriodResultQuery | query | The period query |
Returns
| Type | Description |
|---|---|
| IList<CollectorResult> | Employee collector period results |
GetCollectorResults(CollectorRangeResultQuery)
Get employee collectors results by custom date range
Declaration
public IList<CollectorResult> GetCollectorResults(CollectorRangeResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectorRangeResultQuery | query | The range query |
Returns
| Type | Description |
|---|---|
| IList<CollectorResult> | Employee collector range results |
GetCollectorResults(IEnumerable<string>, DateTime, DateTime, string, PayrunJobStatus?, IEnumerable<string>)
Get employee collectors results by custom date range
Declaration
public IList<CollectorResult> GetCollectorResults(IEnumerable<string> collectorNames, DateTime start, DateTime end, string forecast = null, PayrunJobStatus? jobStatus = null, IEnumerable<string> tags = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | collectorNames | The collector names |
| DateTime | start | The range start date |
| DateTime | end | The range end date |
| string | forecast | The forecast |
| PayrunJobStatus? | jobStatus | The job status |
| IEnumerable<string> | tags | The result tags |
Returns
| Type | Description |
|---|---|
| IList<CollectorResult> | Employee collector range results |
GetConsolidatedCollectorCustomResults(CollectorConsolidatedResultQuery)
Get consolidated employee collector custom results by query
Declaration
public IList<CollectorCustomResult> GetConsolidatedCollectorCustomResults(CollectorConsolidatedResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectorConsolidatedResultQuery | query | The result query |
Returns
| Type | Description |
|---|---|
| IList<CollectorCustomResult> | Consolidated employee collector custom results |
GetConsolidatedCollectorResults(CollectorConsolidatedResultQuery)
Get consolidated employee collectors results by query
Declaration
public IList<CollectorResult> GetConsolidatedCollectorResults(CollectorConsolidatedResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectorConsolidatedResultQuery | query | The result query |
Returns
| Type | Description |
|---|---|
| IList<CollectorResult> | Consolidated employee collector results |
GetConsolidatedWageTypeCustomResults(WageTypeConsolidatedResultQuery)
Get consolidated employee wage type custom results by query
Declaration
public IList<WageTypeCustomResult> GetConsolidatedWageTypeCustomResults(WageTypeConsolidatedResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeConsolidatedResultQuery | query | The result query |
Returns
| Type | Description |
|---|---|
| IList<WageTypeCustomResult> | Consolidated employee wage type custom results |
GetConsolidatedWageTypeResults(WageTypeConsolidatedResultQuery)
Get consolidated employee wage type results by query
Declaration
public IList<WageTypeResult> GetConsolidatedWageTypeResults(WageTypeConsolidatedResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeConsolidatedResultQuery | query | The result query |
Returns
| Type | Description |
|---|---|
| IList<WageTypeResult> | Consolidated employee wage type results |
GetCycleCollectorValue(string)
Get collector year-to-date value
Declaration
[ActionParameter("name", "The collector name", new string[] { "String" }, null, null)]
[PayrunAction("GetCycleCollectorValue", "Get collector year-to-date value", new string[] { "Collector" })]
public ActionValue GetCycleCollectorValue(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Collector name |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetCycleWageTypeValue(decimal)
Get wage type year-to-date value by wage type number
Declaration
[ActionParameter("number", "The wage type number", new string[] { "Dec" }, null, null)]
[PayrunAction("GetCycleWageTypeValue", "Get wage type year-to-date value by wage type number", new string[] { "WageType" })]
public ActionValue GetCycleWageTypeValue(decimal number)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | number |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetCycleWageTypeValue(string)
Get wage type year-to-date value by wage type name
Declaration
[ActionParameter("name", "The wage type name", new string[] { "String" }, null, null)]
[PayrunAction("GetCycleWageTypeValue", "Get wage type year-to-date value by wage type name", new string[] { "WageType" })]
public ActionValue GetCycleWageTypeValue(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetEmployeeRuntimeValue(string)
Get employee runtime value
Declaration
public string GetEmployeeRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| string | The employee runtime value |
GetEmployeeRuntimeValue<T>(string)
Get employee runtime value as deserialized type
Declaration
public T GetEmployeeRuntimeValue<T>(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| T | The employee runtime value |
Type Parameters
| Name | Description |
|---|---|
| T |
GetPayrunJobAttribute(string)
Get payrun job attribute value
Declaration
public object GetPayrunJobAttribute(string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName |
Returns
| Type | Description |
|---|---|
| object |
GetPayrunJobAttribute<T>(string, T)
Get employee attribute typed value
Declaration
public T GetPayrunJobAttribute<T>(string attributeName, T defaultValue = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | Name of the attribute |
| T | defaultValue | The default value |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetPayrunResult(string)
Get payrun result
Declaration
public object GetPayrunResult(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The result name |
Returns
| Type | Description |
|---|---|
| object |
GetPayrunResultValue(string)
Get payrun result value
Declaration
[ActionParameter("name", "The result name", new string[] { "String" }, null, null)]
[PayrunAction("GetPayrunResultValue", "Get payrun result value", new string[] { "Payrun" })]
public ActionValue GetPayrunResultValue(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetPayrunResult<T>(string, T)
Get payrun result
Declaration
public T GetPayrunResult<T>(string name, T defaultValue = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The result name |
| T | defaultValue | The default value |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetPayrunRuntimeValue(string)
Get payrun runtime value
Declaration
public string GetPayrunRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| string | The payrun runtime value |
GetPayrunRuntimeValue<T>(string)
Get payrun runtime value as deserialized type
Declaration
public T GetPayrunRuntimeValue<T>(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| T | The payrun runtime value |
Type Parameters
| Name | Description |
|---|---|
| T |
GetPeriodWageTypeResults(WageTypePeriodResultQuery)
Get employee wage types results by payroll periods
Declaration
public IList<WageTypeResult> GetPeriodWageTypeResults(WageTypePeriodResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypePeriodResultQuery | query | The period query |
Returns
| Type | Description |
|---|---|
| IList<WageTypeResult> | Employee wage type period results |
GetRetroWageTypeValueSum(decimal)
Get sum of retro corrections for a wage type by number
Declaration
public decimal GetRetroWageTypeValueSum(decimal number)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | number | The wage type number |
Returns
| Type | Description |
|---|---|
| decimal | Sum of retro corrections |
GetRetroWageTypeValueSum(string)
Get sum of retro corrections for a wage type by name
Declaration
public decimal GetRetroWageTypeValueSum(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The wage type name |
Returns
| Type | Description |
|---|---|
| decimal | Sum of retro corrections |
GetRetroWageTypeValueSumByName(string)
Get sum of retro corrections for a wage type by name
Declaration
[ActionParameter("name", "The wage type name", new string[] { "String" }, null, null)]
[PayrunAction("GetRetroWageTypeValueSum", "Get sum of retro wage type corrections by name", new string[] { "WageType" })]
public ActionValue GetRetroWageTypeValueSumByName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetRetroWageTypeValueSumByNumber(decimal)
Get sum of retro corrections for a wage type by number
Declaration
[ActionParameter("number", "The wage type number", new string[] { "Dec" }, null, null)]
[PayrunAction("GetRetroWageTypeValueSum", "Get sum of retro wage type corrections by number", new string[] { "WageType" })]
public ActionValue GetRetroWageTypeValueSumByNumber(decimal number)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | number |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetRuntimeValue(string)
Get runtime action value
Declaration
[ActionParameter("key", "The value key", new string[] { "String" }, null, null)]
[PayrunAction("GetRuntimeValue", "Get payrun runtime value", new string[] { "Runtime" })]
public ActionValue GetRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetWageTypeCustomResults(WageTypeRangeResultQuery)
Get employee wage type custom results by query
Declaration
public IList<WageTypeCustomResult> GetWageTypeCustomResults(WageTypeRangeResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeRangeResultQuery | query | The result query |
Returns
| Type | Description |
|---|---|
| IList<WageTypeCustomResult> | Consolidated employee wage type custom results |
GetWageTypeCycleResults(WageTypeCycleResultQuery)
Get employee wage types results by query
Declaration
public IList<WageTypeResult> GetWageTypeCycleResults(WageTypeCycleResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeCycleResultQuery | query | The cycle query |
Returns
| Type | Description |
|---|---|
| IList<WageTypeResult> | Employee wage type cycle results |
GetWageTypeName(decimal)
Get wage type name by number
Declaration
public string GetWageTypeName(decimal wageTypeNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | wageTypeNumber | The wage type number |
Returns
| Type | Description |
|---|---|
| string |
GetWageTypeNumber(string)
Get wage type number by name
Declaration
public decimal GetWageTypeNumber(string wageTypeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | wageTypeName | The wage type name |
Returns
| Type | Description |
|---|---|
| decimal |
GetWageTypeResults(WageTypeRangeResultQuery)
Get employee wage types results by query
Declaration
public IList<WageTypeResult> GetWageTypeResults(WageTypeRangeResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeRangeResultQuery | query | The range query |
Returns
| Type | Description |
|---|---|
| IList<WageTypeResult> | Employee wage type range results |
GetWageTypeResults(IEnumerable<decimal>, DateTime, DateTime, string, PayrunJobStatus?, IEnumerable<string>)
Get employee wage type results by date range
Declaration
public IList<WageTypeResult> GetWageTypeResults(IEnumerable<decimal> wageTypeNumbers, DateTime start, DateTime end, string forecast = null, PayrunJobStatus? jobStatus = null, IEnumerable<string> tags = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<decimal> | wageTypeNumbers | The wage type numbers |
| DateTime | start | The range start date |
| DateTime | end | The range end date |
| string | forecast | The forecast |
| PayrunJobStatus? | jobStatus | The job status |
| IEnumerable<string> | tags | The result tags |
Returns
| Type | Description |
|---|---|
| IList<WageTypeResult> | Employee wage type range results |
GetWageTypeRetroResultSum(decimal)
Get summary of retro wage type results
Declaration
public decimal GetWageTypeRetroResultSum(decimal wageTypeNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | wageTypeNumber | The wage type number |
Returns
| Type | Description |
|---|---|
| decimal | Retro employee wage type value (difference) |
GetWageTypeRetroResults(WageTypeResultQuery)
Get retro employee retro wage type results by periods
Declaration
public IList<decimal> GetWageTypeRetroResults(WageTypeResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeResultQuery | query | The query |
Returns
| Type | Description |
|---|---|
| IList<decimal> | Retro employee retro wage type values |
HasEmployeeRuntimeValue(string)
Test for existing employee runtime value
Declaration
public bool HasEmployeeRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| bool | True if the runtime value exists |
HasPayrunRuntimeValue(string)
Test for existing payrun runtime value
Declaration
public bool HasPayrunRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| bool | True if the runtime value exists |
RemovePayrunJobAttribute(string)
Remove payrun job attribute
Declaration
public bool RemovePayrunJobAttribute(string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | Name of the attribute |
Returns
| Type | Description |
|---|---|
| bool |
RemoveRuntimeValue(string)
Remove runtime action value
Declaration
[ActionParameter("key", "The value key", new string[] { "String" }, null, null)]
[PayrunAction("RemoveRuntimeValue", "Remove payrun runtime value", new string[] { "Runtime" })]
public void RemoveRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
SetEmployeeRuntimeValue(string, string)
Set employee runtime value
Declaration
public void SetEmployeeRuntimeValue(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
| string | value | The employee runtime value, use null to remove the runtime value |
SetEmployeeRuntimeValue<T>(string, T)
Set employee runtime value as serialized type
Declaration
public void SetEmployeeRuntimeValue<T>(string key, T value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
| T | value | The employee runtime value |
Type Parameters
| Name | Description |
|---|---|
| T |
SetPayrunJobAttribute(string, object)
Set payrun job attribute value
Declaration
public void SetPayrunJobAttribute(string attributeName, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | Name of the attribute |
| object | value | The attribute value |
SetPayrunResult(string, object, DateTime, DateTime, ValueType?, string, IEnumerable<string>, Dictionary<string, object>, string)
Set payrun result
Declaration
public void SetPayrunResult(string name, object value, DateTime startDate, DateTime endDate, ValueType? valueType = null, string slot = null, IEnumerable<string> tags = null, Dictionary<string, object> attributes = null, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The result name |
| object | value | The result value |
| DateTime | startDate | The start date |
| DateTime | endDate | The end date |
| ValueType? | valueType | The result value type |
| string | slot | The result slot |
| IEnumerable<string> | tags | The result tags |
| Dictionary<string, object> | attributes | The wage type custom result attributes |
| string | culture | The result culture |
SetPayrunResult(string, object, ValueType?, string, IEnumerable<string>, Dictionary<string, object>, string)
Set payrun result using the current period
Declaration
public void SetPayrunResult(string name, object value, ValueType? valueType = null, string slot = null, IEnumerable<string> tags = null, Dictionary<string, object> attributes = null, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The result name |
| object | value | The result value |
| ValueType? | valueType | The result value type |
| string | slot | The result slot |
| IEnumerable<string> | tags | The result tags |
| Dictionary<string, object> | attributes | The wage type custom result attributes |
| string | culture | The result culture |
SetPayrunResultValue(string, object, string)
Set payrun result value
Declaration
[ActionParameter("name", "The result name", new string[] { "String" }, null, null)]
[ActionParameter("value", "The value to set", null, null, null)]
[ActionParameter("type", "The value type (default: Money), [StringType]", null, null, null)]
[PayrunAction("SetPayrunResultValue", "Set payrun result value", new string[] { "Payrun" })]
public void SetPayrunResultValue(string name, object value, string type = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | |
| object | value | |
| string | type |
SetPayrunRuntimeValue(string, string)
Set payrun runtime value
Declaration
public void SetPayrunRuntimeValue(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
| string | value | The payrun runtime value, use null to remove the runtime value |
SetPayrunRuntimeValue<T>(string, T)
Set payrun runtime value as serialized type
Declaration
public void SetPayrunRuntimeValue<T>(string key, T value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
| T | value | The payrun runtime value |
Type Parameters
| Name | Description |
|---|---|
| T |
SetRuntimeValue(string, object)
Set runtime action value
Declaration
[ActionParameter("key", "The value key", new string[] { "String" }, null, null)]
[ActionParameter("value", "The value to set", null, null, null)]
[PayrunAction("SetRuntimeValue", "Set payrun runtime value", new string[] { "Runtime" })]
public void SetRuntimeValue(string key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | |
| object | value |