Skip to content

Commit 630f0f5

Browse files
author
Jani Giannoudis
committed
added abort execution to the wage type value function and runtime
1 parent ab1fc9c commit 630f0f5

3 files changed

Lines changed: 37 additions & 4 deletions

File tree

Client.Scripting/Function/WageTypeValueFunction.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* WageTypeValueFunction */
1+
/* WageTypeValueFunction */
22

33
// ReSharper disable RedundantUsingDirective
44
using System;
@@ -95,6 +95,15 @@ protected WageTypeValueFunction(string sourceFileName) :
9595
/// <summary>Restart execution of wage type calculation</summary>
9696
public void RestartExecution() => Runtime.RestartExecution();
9797

98+
/// <summary>
99+
/// Aborts the wage type sequence for the current employee immediately.
100+
/// All subsequent wage types are skipped for this employee in this payrun.
101+
/// CollectorEnd and PayrunEmployeeEnd continue normally.
102+
/// </summary>
103+
/// <param name="reason">Optional reason written to the payrun log.</param>
104+
public void AbortExecution(string reason = null) =>
105+
Runtime.AbortExecution(reason);
106+
98107
#region Action
99108
#endregion
100109

@@ -111,4 +120,4 @@ public object GetValue()
111120
// compiler will optimize this out if the code provides a return
112121
return null;
113122
}
114-
}
123+
}

Client.Scripting/PayrollEngine.Client.Scripting.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8429,6 +8429,14 @@
84298429
<member name="M:PayrollEngine.Client.Scripting.Function.WageTypeValueFunction.RestartExecution">
84308430
<summary>Restart execution of wage type calculation</summary>
84318431
</member>
8432+
<member name="M:PayrollEngine.Client.Scripting.Function.WageTypeValueFunction.AbortExecution(System.String)">
8433+
<summary>
8434+
Aborts the wage type sequence for the current employee immediately.
8435+
All subsequent wage types are skipped for this employee in this payrun.
8436+
CollectorEnd and PayrunEmployeeEnd continue normally.
8437+
</summary>
8438+
<param name="reason">Optional reason written to the payrun log.</param>
8439+
</member>
84328440
<member name="M:PayrollEngine.Client.Scripting.Function.WageTypeValueFunction.GetValue">
84338441
<summary>Entry point for the runtime</summary>
84348442
<remarks>Internal usage only, do not call this method</remarks>
@@ -11501,6 +11509,14 @@
1150111509
<member name="M:PayrollEngine.Client.Scripting.Runtime.IWageTypeValueRuntime.RestartExecution">
1150211510
<summary>Restart execution of wage type calculation</summary>
1150311511
</member>
11512+
<member name="M:PayrollEngine.Client.Scripting.Runtime.IWageTypeValueRuntime.AbortExecution(System.String)">
11513+
<summary>
11514+
Aborts the wage type sequence for the current employee immediately.
11515+
All subsequent wage types are skipped. CollectorEnd and PayrunEmployeeEnd
11516+
continue normally.
11517+
</summary>
11518+
<param name="reason">Optional reason written to the payrun log.</param>
11519+
</member>
1150411520
<member name="M:PayrollEngine.Client.Scripting.Runtime.IWageTypeValueRuntime.GetValueActions">
1150511521
<summary>Get wage type value actions</summary>
1150611522
</member>

Client.Scripting/Runtime/IWageTypeValueRuntime.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-

1+
22
namespace PayrollEngine.Client.Scripting.Runtime;
33

44
/// <summary>Runtime for the wage type value function <see cref="Function.WageTypeValueFunction"/></summary>
@@ -10,6 +10,14 @@ public interface IWageTypeValueRuntime : IWageTypeRuntime
1010
/// <summary>Restart execution of wage type calculation</summary>
1111
void RestartExecution();
1212

13+
/// <summary>
14+
/// Aborts the wage type sequence for the current employee immediately.
15+
/// All subsequent wage types are skipped. CollectorEnd and PayrunEmployeeEnd
16+
/// continue normally.
17+
/// </summary>
18+
/// <param name="reason">Optional reason written to the payrun log.</param>
19+
void AbortExecution(string reason = null);
20+
1321
/// <summary>Get wage type value actions</summary>
1422
string[] GetValueActions();
15-
}
23+
}

0 commit comments

Comments
 (0)