- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 17
 
Basic Payroll
In diesem Beispiel wird eine Minimalszenario einer Payroll aufgezeigt:
- Aufbau des Payroll Modells
 - Voraussetzungen gewährleisten
 - Payroll Setup
 - Automatisiertes Payroll Testing
 
Die Payroll Engine bildet die Gehaltsabrechnung mit folgenden Objekten ab:
Die Mitarbeiter eines Mandanten sind einer oder mehrerer Divisions zugeordnet. Die Lohläufe beziehen sich auf eine Division, so dass Mitarbeiter aus verschiedenen Divisions den Lohn beziehen können. Das folgende Minimalbeispiel besitzt einen Mitarbeiter mit dem Fall Gehalt.
Um eine Payroll zu erstellen muss der Backend Server der Payroll Engine gestartet sein.
Die Payroll kann auf drei Arten eingerichtet werden:
- Rest API
- REST API Development Tool, z.B. Postman
 
 - Payroll Console
- Lokaler Zugriff auf das Payroll Engine Exchange JSON Schema
 - JSON Editor, z.B. Visual Studio Code
 
 - Web Applikation
- Der Web Application Server ist gestartet
 
 
Die folgenden Schritte beschreiben das Einrichten einer Payroll:
| Step | JSON | Web Application | REST API | 
|---|---|---|---|
| Set JSON schema | 02 | 
||
| Set object creation date | 03 | 
||
| Add Tenant | 04-07 | 
Tenants > Add | CreateTenant | 
| Add User | 08-15 | 
Users > Add | CreateUser | 
| Add Division | 16-21 | 
Divisons > Add | CreateDivision | 
| Add Employee | 22-31 | 
Employees > Add | CreateEmployee | 
| Add Regulation | 32-34 | 
Regulations > Add | CreateRegulation | 
| Add Case | 35-38 | 
Regulation > Cases > Add | CreateCase | 
| Add Case Field | 39-45 | 
Regulation > Case Fields > Add | CreateCaseField | 
| Add Wage Type | 48-54 | 
Regulation > Wage Types > Add | CreateWageType | 
| Add Payroll Layer | 61-66 | 
Payroll Layers > Add | CreatePayrollLayer | 
| Add Payroll | 57-60 | 
Payrolls > Add | CreatePayroll | 
| Add Payrun | 69-73 | 
Payruns > Add | CreatePayrun | 
Beispiel Payroll Basic.json:
1{
2  "$schema": "PayrollEngine.Exchange.schema.json",
3  "createdObjectDate": "2023-01-01T00:00:00.0Z",
4  "tenants": [
5    {
6      "identifier": "StartTenant",
7      "culture": "en-US",
8      "users": [
9        {
10          "identifier": "[email protected]",
11          "firstName": "Lucy",
12          "lastName": "Smith",
13          "language": "English"
14        }
15      ],
16      "divisions": [
17        {
18          "name": "StartDivision",
19          "culture": "en-US"
20        }
21      ],
22      "employees": [
23        {
24          "identifier": "mario.nuñ[email protected]",
25          "firstName": "Mario",
26          "lastName": "Nuñez",
27          "divisions": [
28            "StartDivision"
29          ]
30        }
31      ],
32      "regulations": [
33        {
34          "name": "StartRegulation",
35          "cases": [
36            {
37              "name": "Salary",
38              "caseType": "Employee",
39              "fields": [
40                {
41                  "name": "Salary",
42                  "valueType": "Money",
43                  "timeType": "CalendarPeriod"
44                }
45              ]
46            }
47          ],
48          "wageTypes": [
49            {
50              "wageTypeNumber": 100,
51              "name": "Salary",
52              "valueExpression": "CaseValue[\"Salary\"]"
53            }
54          ]
55        }
56      ],
57      "payrolls": [
58        {
59          "name": "StartPayroll",
60          "divisionName": "StartDivision",
61          "layers": [
62            {
63              "level": 1,
64              "regulationName": "StartRegulation"
65            }
66          ]
67        }
68      ],
69      "payruns": [
70        {
71          "name": "StartPayrun",
72          "payrollName": "StartPayroll"
73        }
74      ]
75    }
76  ]
77}Die Schritte zur Erstellung einer Payroll im Detail:
- 
02: Adjust the JSON schema path to your local environment - 
03: Default creation date for any object - 
07: The tenant culture - 
13: The user language - 
19: The division culture, overrides the tenant culture - 
28: The employee division, can be multiple - 
38: The case type: global, national, company or employee - 
42: The case field value type: money - 
43: The case field time type calendar period - 
50: The wage type number100, controls the payrun process order - 
52: The wage type value expression: calculated from case value - 
60: Payroll association to the division - 
64: Payroll layer association to the regulation - 
72: Payrun association to the payroll 
Die Felder
Identifier[06/10/24],Name[18/34/59/71] sowie dieWageTypeNumber[50] müssen eindeutig sein.
Die JSON Datei wird mit der Payroll Konsole Kommando PayrollImport zum Backend übermittelt:
PayrollConsole PayrollImport Payroll.json
Setup von Reports siehe TODO
Beim Testen der Payroll werden die Benutzereingaben und der Lohnlauf simmuliert und überprüft, ob die berechneten Lohndaten korrekt sind:
| Step | JSON | 
|---|---|
| Set link to JSON schema | 02 | 
| Add Employee Case | 11-28 | 
| Add Payrun Job | 31-44 | 
| Test Payrun Results | 45-56 | 
Die Schritte zum Testen einer Payroll im Detail:
- 
02: Adjust the JSON schema path to your local environment - 
06: Do not update the tenant - 
10: Do not update the payroll - 
14: The employee of the case - 
15: The divisivion(s) of the employee case - 
21: The new employee salary - 
22: The salary start date - 
23: The change created data, simulation of past salary change - 
34: Payrun job association to the payrun - 
37: Payrun job employee(s) - 
40: Complete the payrun job, test scenario - 
41: Payrun period date - 
42: Payrun execution date, simulation of past payrun execution - 
48: Employee to test the result - 
51: The wage type to test - 
52: The expected wage type value 
Beispiel Payroll JSON Test Basic.Test.et.json:
1{
2  "$schema": "PayrollEngine.Exchange.schema.json",
3  "tenants": [
4    {
5      "identifier": "StartTenant",
6      "updateMode": "NoUpdate",
7      "payrolls": [
8        {
9          "name": "StartPayroll",
10          "updateMode": "NoUpdate",
11          "cases": [
12            {
13              "userIdentifier": "[email protected]",
14              "employeeIdentifier": "mario.nuñ[email protected]",
15              "divisionName": "StartDivision",
16              "case": {
17                "caseName": "Salary",
18                "values": [
19                  {
20                    "caseFieldName": "Salary",
21                    "value": "5000",
22                    "start": "2023-01-01T00:00:00.0Z",
23                    "created": "2022-11-04T00:00:00.0Z"
24                  }
25                ]
26              }
27            }
28          ]
29        }
30      ],
31      "payrunJobInvocations": [
32        {
33          "name": "StartPayrunJob.Jan23",
34          "payrunName": "StartPayrun",
35          "userIdentifier": "[email protected]",
36          "employeeIdentifiers": [
37            "mario.nuñ[email protected]"
38          ],
39          "reason": "Test Payrun Jan 23",
40          "jobStatus": "Complete",
41          "periodStart": "2023-01-01T00:00:00.0Z",
42          "evaluationDate": "2023-02-01T00:00:00.0Z"
43        }
44      ],
45      "payrollResults": [
46        {
47          "payrunJobName": "StartPayrunJob.Jan23",
48          "employeeIdentifier": "mario.nuñ[email protected]",
49          "wageTypeResults": [
50            {
51              "wageTypeNumber": 100,
52              "value": 5000
53            }
54          ]
55        }
56      ]
57    }
58  ]
59}Der Payroll Konsole Kommando PayrunEmployeeTest erstellt für jeden Testlauf eine Kopie des Mitarbeiters.
PayrollConsole PayrunEmployeeTest Test.et.json
Neben dem PayrunEmployeeTest [*.et.json] unterstützt die Payroll Konsole weitere automatisierte Testverfahren:
- 
PayrunTest: Testen den Lohnlauf mit einem temporären Mandanten [*.pt.json] - 
CaseTest: Testen von Cases [*.ct.json] - 
ReportTest: Testen von Reports [*.rt.json] 
The next steps are:
- Build a Distributed Payroll
 - Build a Report
 - Explore the Payroll Engine Resources
 
    🤝 Thank you for supporting this project with a donation.
    ⚡ This is a pre-relase version of the initial development, please read the restrictions.
- Payroll Engine