Skip to content

Basic Payroll

Jani Giannoudis edited this page Jun 20, 2023 · 30 revisions

Payroll Model

Eine Firma wird in der Payroll Engine mit folgenden Objekten abgebildet:
Payroll Model

Die Mitarbeiter eines Mandanten sind in Divisions unterteilt, welche als Grundlage für den Lohlauf dienen. Mitarbeiter können mehreren Divisions zugeordnet sein und aus diesen den Lohn beziehen.

Voraussetzungen

Um eine Payroll zu erstellen muss der Backend Server der Payroll Engine gestartet sein.

Die Payroll kann auf drei Arten eingerichtet werden:

Payroll Setup

Die folgenden Schritte beschreiben das Einrichten der Payroll:

Step JSON Web Application REST API
Set JSON schema 02
Set 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 JSON Setup Payroll.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 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: caelendar period
  • 50: The wage type number, controls to is the payrun process order
  • 52: The wage type value expression: access to the 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 die WageTypeNumber [50] müssen eindeutig sein.

Die JSON Datei wird mit der Payroll Konsole mit dem PayrollImport Kommando zum Backend übermittelt:

PayrollConsole PayrollImport Payroll.json

Setup von Reports siehe TODO

Payroll Test

Das Payaroll Setup kann mit folgenden Schritten überprüft werden:

Step JSON
Set link to JSON schema 02
Add Employee Case 09-26
Add Payrun Job 29-42
Test Payrun Results 43-54

Die Schritte im Detail:

  • 02: Adjust the JSON schema path to your local environment
  • 12: The employee of the case
  • 13: The divisivion(s) of the employee case
  • 19: The new employee salary
  • 20: The salary start date
  • 21: The change created data, simulation of past salary change
  • 32: Payrun Job association to the payrun
  • 35: Payrun Job employee(s)
  • 38: Complete the payrun job, test scenario
  • 39: Payrun period date
  • 40: Payrun execution date, simulation of past payrun execution
  • 46: Employee to test the result
  • 49: The wage type to test
  • 50: The expected wage type value

Beispiel Payroll JSON Test Test.et.json:

1{
2  "$schema": "PayrollEngine.Exchange.schema.json",
3  "tenants": [
4    {
5      "identifier": "StartTenant",
6      "payrolls": [
7        {
8          "name": "StartPayroll",
9          "cases": [
10            {
11              "userIdentifier": "[email protected]",
12              "employeeIdentifier": "mario.nuñ[email protected]",
13              "divisionName": "StartDivision",
14              "case": {
15                "caseName": "Salary",
16                "values": [
17                  {
18                    "caseFieldName": "Salary",
19                    "value": "5000",
20                    "start": "2023-01-01T00:00:00.0Z",
21                    "created": "2022-11-04T00:00:00.0Z"
22                  }
23                ]
24              }
25            }
26          ]
27        }
28      ],
29      "payrunJobInvocations": [
30        {
31          "name": "StartPayrunJob.Jan23",
32          "payrunName": "StartPayrun",
33          "userIdentifier": "[email protected]",
34          "employeeIdentifiers": [
35            "mario.nuñ[email protected]"
36          ],
37          "reason": "Test Payrun Jan 23",
38          "jobStatus": "Complete",
39          "periodStart": "2023-01-01T00:00:00.0Z",
40          "evaluationDate": "2023-02-01T00:00:00.0Z"
41        }
42      ],
43      "payrollResults": [
44        {
45          "payrunJobName": "StartPayrunJob.Jan23",
46          "employeeIdentifier": "mario.nuñ[email protected]",
47          "wageTypeResults": [
48            {
49              "wageTypeNumber": 100,
50              "value": 5000
51            }
52          ]
53        }
54      ]
55    }
56  ]
57}

Der PayrunEmployeeTest der Payroll Konsole 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]

Next steps

The next steps are:

Clone this wiki locally