Skip to content

Commit bc46cc9

Browse files
author
Jani Giannoudis
committed
payroll runtime and function: added method lookup apply range value
updated version to 0.9.0-beta.12
1 parent 38446f0 commit bc46cc9

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

Client.Scripting/Function/PayrollFunction.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,16 @@ public T GetRangeObjectLookup<T>(string lookupName, decimal rangeValue, string o
978978
return string.IsNullOrWhiteSpace(value) ? default : value.ObjectValueJson<T>(objectKey);
979979
}
980980

981+
/// <summary>Apply a range value to the lookup ranges, and multiplying the lookup value with the range amount</summary>
982+
/// <param name="lookupName">The lookup name</param>
983+
/// <param name="rangeValue">The range value</param>
984+
/// <param name="valueFieldName">Value field name</param>
985+
/// <remarks>Only numeric JSON lookup values are supported.
986+
/// The first lookup range value must be zero.</remarks>
987+
/// <returns>Summary of all lookup ranges</returns>
988+
public decimal ApplyRangeValue(string lookupName, decimal rangeValue, string valueFieldName = null) =>
989+
Runtime.ApplyRangeValue(lookupName, rangeValue, valueFieldName);
990+
981991
#endregion
982992

983993
#region Actions

Client.Scripting/PayrollEngine.Client.Scripting.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182

183183
<ItemGroup>
184184
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
185-
<PackageReference Include="PayrollEngine.Client.Core" Version="0.9.0-beta.11" />
185+
<PackageReference Include="PayrollEngine.Client.Core" Version="0.9.0-beta.12" />
186186
</ItemGroup>
187187

188188
<!-- include xml documention files and json schemas to the nuget package -->

Client.Scripting/PayrollEngine.Client.Scripting.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6470,6 +6470,15 @@
64706470
<param name="lookupKey">The lookup key (optional)</param>
64716471
<param name="culture">The culture, null for the system culture (optional)</param>
64726472
</member>
6473+
<member name="M:PayrollEngine.Client.Scripting.Function.PayrollFunction.ApplyRangeValue(System.String,System.Decimal,System.String)">
6474+
<summary>Apply a range value to the lookup ranges, and multiplying the lookup value with the range amount</summary>
6475+
<param name="lookupName">The lookup name</param>
6476+
<param name="rangeValue">The range value</param>
6477+
<param name="valueFieldName">Value field name</param>
6478+
<remarks>Only numeric JSON lookup values are supported.
6479+
The first lookup range value must be zero.</remarks>
6480+
<returns>Summary of all lookup ranges</returns>
6481+
</member>
64736482
<member name="F:PayrollEngine.Client.Scripting.Function.PayrollFunction.ConditionConsequentMarker">
64746483
<summary>Condition consequent marker</summary>
64756484
</member>
@@ -9964,6 +9973,15 @@
99649973
<param name="culture">The value culture</param>
99659974
<returns>The lookup value matching tho the lookup key</returns>
99669975
</member>
9976+
<member name="M:PayrollEngine.Client.Scripting.Runtime.IPayrollRuntime.ApplyRangeValue(System.String,System.Decimal,System.String)">
9977+
<summary>Apply a range value to the lookup ranges, and multiplying the lookup value with the range amount</summary>
9978+
<param name="lookupName">The lookup name</param>
9979+
<param name="rangeValue">The range value</param>
9980+
<param name="valueFieldName">Value field name</param>
9981+
<remarks>Only numeric JSON lookup values are supported.
9982+
The first lookup range value must be zero.</remarks>
9983+
<returns>Summary of all lookup ranges</returns>
9984+
</member>
99679985
<member name="T:PayrollEngine.Client.Scripting.Runtime.IPayrunEmployeeAvailableRuntime">
99689986
<summary>Runtime for the payrun employee available function <see cref="T:PayrollEngine.Client.Scripting.Function.PayrunEmployeeAvailableFunction"/></summary>
99699987
</member>

Client.Scripting/Runtime/IPayrollRuntime.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,15 @@ public interface IPayrollRuntime : IRuntime
152152
/// <returns>The lookup value matching tho the lookup key</returns>
153153
string GetRangeLookup(string lookupName, decimal rangeValue, string lookupKey = null, string culture = null);
154154

155+
/// <summary>Apply a range value to the lookup ranges, and multiplying the lookup value with the range amount</summary>
156+
/// <param name="lookupName">The lookup name</param>
157+
/// <param name="rangeValue">The range value</param>
158+
/// <param name="valueFieldName">Value field name</param>
159+
/// <remarks>Only numeric JSON lookup values are supported.
160+
/// The first lookup range value must be zero.</remarks>
161+
/// <returns>Summary of all lookup ranges</returns>
162+
decimal ApplyRangeValue(string lookupName, decimal rangeValue, string valueFieldName = null);
163+
155164
#endregion
156165

157166
}

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>0.9.0-beta.11</Version>
5+
<Version>0.9.0-beta.12</Version>
66
<FileVersion>0.9.0</FileVersion>
77
<InformationalVersion></InformationalVersion>
88
<Authors>Jani Giannoudis</Authors>

0 commit comments

Comments
 (0)