-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWageTypeReportEndFunction.cs
More file actions
37 lines (31 loc) · 1.02 KB
/
WageTypeReportEndFunction.cs
File metadata and controls
37 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.Data;
using PayrollEngine.Client.Scripting;
using PayrollEngine.Client.Scripting.Runtime;
namespace PayrollEngine.Client.Tutorial.ScriptingDevelopment;
[ReportEndFunction(
tenantIdentifier: "SimplePayroll",
userIdentifier: "peter.schmid@foo.com",
regulationName: "SimplePayroll")]
public class WageTypeReportEndFunction(IReportEndRuntime runtime) : Scripting.Function.ReportEndFunction(runtime)
{
[ReportEndScript(
reportName: "WageTypesReport",
culture: "de-CH")]
public object ReportEndScript()
{
// wage types
var regulations = Tables["Regulations"];
if (regulations == null || regulations.Rows.Count != 1)
{
throw new ScriptException("Missing regulation.");
}
DataRow regulation = regulations.Rows[0];
if (regulation["Id"] is not int id || id <= 0)
{
throw new ScriptException("Missing regulation.");
}
// query regulation wage types
// ...
return null;
}
}