Introduction and purpose
The following is a guide to set up the integration from Emply to Lessor PM by using API.
The integration is set up in collaboration with the customer, an Emply consultant and a Lessor PM consultant.
The guide contains the following steps:
- Preparation for setup
- Setup in Emply
- Setup in Lessor PM
- Field types in Emply
- Please note when setting up the integration
Step 1 - Preparation for setup
The customer, the Lessor PM consultant and the Emply consultant must have clarified in advance which fields/data the customer wants to synchronize prior to setting up the integration.
The customer must have received and read the customer guide.
Please note that data can only be synchronized one way from Emply to Lessor PM in most fields specified under master data in Emply.
Step 2 - Setup in Emply
In the following setup, 3 points are indicated with color. This information will later be used for the setup in Lessor PM. The 3 points are:
2.1 - Find the site address
Go to Settings > Account > Info/Billing > Site address
2.2 - Create API key
Go to Settings > Integrations > API > click on '+ New API key' and give it the title "Lessor PM" > finish by click Save.
You have now created an API key #2.
Remember to activate the API key on the right, when the integration is ready to be activated in Lessor PM:
2.3 - Create JSON export
A JSON export URL for Employment (Payroll) needs to be created.
Go to Settings > Integrations > Export > click on '+ New export' > choose 'JSON Package' and give it the title "Lessor PM".
Copy and insert the below JSON Package:
{
"employeeId": "[employee.id]",
"employeeEmail": "[employee.email]",
"primary": {
"current": {
"jobTitle": "[payroll.primary.jobtitle]",
"salary": "[payroll.primary.salary]",
"workingHoursMonthly": "[payroll.primary.working_hours_monthly]",
"effectiveDate": "[payroll.primary.effective_date]",
"employmentDate": "[payroll.primary.employment_date]",
"seniorityDate": "[payroll.primary.seniority_date]",
"resignationDate": "[payroll.primary.resignation_date]",
"settlinggroup": "[payroll.primary.afregningsgruppekode]"
}
},
"secondary": {
"current": {
"resignationDate": "[payroll.secondary.resignation_date]"
}
}
}
Please note that
- all brackets that appear in the above JSON Package must be included
- setup and naming of the fields in Emply can differ, and you must therefore check that the merge fields in the above JSON Package match the ones you use in Emply
- check that the indents in the JSON Package are correct when it is inserted in Emply
Below you can see how to set up the JSON export:
Copy the GUID key under 'GUID' #3:
Step 3 - Setup in LessorPM
3.1 - Create integrations system Emply
Go to Opsætning > Løn > Integrationssystemer.
Create a new line. The code must be EMPLY with Get URL = https://
Explanation for the field "Get Marker":
The field is set with current date and time when a new Code is created, and is changed every time it is synchronized in Lessor PM. The date is compared with the updated date in Emply, so no old creations/changes are transferred. It will only be the date itself (not time) that is used for synchronization, so if it is synchronized several times on the same date, changes and log information will come several times.
- If the employees, before starting the integration, have been created in Lessor PM, nothing further needs to be done under this point. Changes made in Emply after this date will be synchronized.
- If the need arises, the date in the "Get Marker" field can be changed back in time so that services are synchronized from the selected date onwards.
The field is read:
2022 - 06 - 02 - 03 - 40 - 23
Be very careful and backup the Lessor PM database if it is necessary to correct the field for a customer who has already synchronized for a while.
Note that when creating the Integration System with the code EMPLY, an audit log will automatically be created for the master card, hires and fixed salary parts in Lessor PM. The audit log records what changes have been made from/to, by whom and when. Data from the audit log can be retrieved via a report as described later in this guide. Read more under step 5.
3.2 - Mapping of fields
Mapping of Emply fields to Lessor PM fields is done by specifying the header of the Emply fields in the Lessor PM setup. If fields with their own headings are changed in Emply, they must also be changed in Lessor PM. A new field "Payroll Number" must be created for the Employee code in Lessor PM.
For example:
CODE = Payroll Number (required to recognize the employee in Lessor PM)
FirstName = First name
LastName = Last name
Please note that Upper and lower case letters must be the same.
Go to Opsætning > Løn > Integrationsfelter - Emply. Next to the fields, a check mark must be placed to indicate whether the field should be active or not (data is received in the field).
3.3 - Default fields that can be synchronized from Emply
Standard fields created for the synchronization are shown here. The customer can define customer fields in Lessor PM and these can be synchronized if they are available under the employee's master data in Emply. Dropdown fields (Fields with Oid dependencies) cannot be synchronized.
3.4 - Setting up Servicejob
Go to Opsætning > Servicejob.
Create a new service job with code EMPLY.
Here you must specify:
- Customer specific URL #1
- API key #2
- JSON export GUID URL #3
All 3 are from Emply.
Copy the following code and replace #1; #2; #3 with the customer's information:
public void Run( ISessionProvider sessionProvider)
{
var job = new PM.Services.EmplyDataExchangeserviceJob();
await job.Run(sessionProvider, "lessorpm-sandkasse",
"31037dacb3d04bf28d64ade78ea13ac563f5688b328a4105bde98ce213583071",
"56534105-aa26-4fd4-b7d2-120581c7d507");
}
Once the whole setup is agreed to and customized with the customer, a customization can be made on an employee and you can press the 'Kør'button to check if there is a connection between the 2 systems.
Step 4 - Field types in Emply
There are some fields that typically need to be created in Emply before they can be used. These fields must be the same type of data to be entered in the field. That is, text fields must be of type text, number fields must be of type number, and amount fields must be of type money.
However, the type for Employment rate and Adjustment rate can be both number and money, but must be 4 decimals.
In general, the number of decimal places must be the same as the field in Lessor PM (2 decimal places or 4 decimal places).
The selection field in Emply must be labeled with a heading similar to the field in Lessor PM. The options must be indicated with "Ja" (Yes) or "Nej" (No), as shown in the example below:
Step 5 - Please note when setting up the integration
5.1 - What must be ensured before synchronization
- That the content of the fields under master data and employment in Emply is the same as the corresponding fields in Lessor PM.
5.2 - What happens during the synchronization
- All employees that are changed in Emply are synchronized without exception.
- When changing an employee in Emply, it will be the update date that is compared to the Get Marker date in Lessor PM.
- When the synchronization is activated in Lessor PM, the fields that are specified as active under Opsætning > Løn > Integrationsfelter - Emplywill be updated.
- It will always be data from Emply that overwrites data in Lessor PM.
- If an employee is now created in Emply, the employee will be synchronized by first running the synchronization with the employment date specified.
- If the update date in Emply occurs any later than the specified date, the change will only be synchronized when the update date is the same or earlier than the date.
- Under Udskrifter > Sikkerhed > Auditlog in Lessor PM, you can see which employees have been changed, which fields have been changed with old and new data, and when. It is possible to limit the report on dates and which users have made the changes. If there is automatic integration, it will typically be the user Lessoradm that is used.
- Under Opsætning > Sikkerhed > Log in Lessor PM, there will be information of a more technical nature.
5.3 - Employment periods
Do not change the start date of existing employment or create a new employment for the employee in Emply without also doing so in Lessor PM. The primary hire period in Emply is synchronized with the corresponding hire period in Lessor PM.
There is no update when:
- An employment period already exists for the employee in Lessor PM with a different hire date.
- There is a resignation and the resignation date is filled in Lessor PM.
If the termination date is changed in Emply, the date must be manually changed in Lessor PM.
A notification will be given in Lessor PM under the Emply log if the employment period cannot be updated.
5.4 - Settling group code
The settling group code from Emply is synchronized on the employment period in Lessor PM.
There is no update when:
- The settling group code changes.
- The settling group code does not exist in Lessor PM.
A message will be given in Lessor PM under the Emply log if the settling group code cannot be updated.
5.5 - Bank account
Registration number and Account number from Emply are synchronized to the employee's bank account in Lessor PM.
Bank account is created/aligned in Lessor PM after:
- The payroll type selected under Integrationsfelter - Emply next to EmployeeBankAccount.
- Updated in the future, if the from date is used in Emply.
If NemKonto is used for payment of salary, Bank accounts should not be synchronized.
5.6 - Employee number (important)
A new field "Salary number" (Lønnummer) must be created. The Employee Code must be entered in the field for Lessor PM.
The Employee Code field in Emply must not be used.
The employee in Lessor PM is not updated when:
- Social Security Number has changed.
- First name and/or Address have changed.
Risks:
- Do not change the Payroll Number in Emply. Instead, the employee must be created again with a new Salary number.
Changing the Salary number in Emply to an Employee Code that does not exist in Lessor PM will create a new employee code and thus the employee may receive double salary, etc. We cannot prevent this.
Information about new employee code created in Lessor PM is provided under Hjælp > Emply log.
5.7 - Organization codes / Departments
Departments of an employee in Emply are always synchronized to Organization Codes in Lessor PM.
Each Department Code in Emply must be associated with a "Cost Center ID" that is exactly the same as the Organization Code in Lessor PM.
The Organization Codes are created/adjusted in Lessor PM after:
- If a Department Code in Emply that does not exist in Lessor PM is changed on the individual employee, the Department Code will automatically be created and changed on the employee.
- If a new organization is created in Emply that does not exist in Lessor PM, a new company code is created in Lessor PM. There will be a message under the Emply log in Lessor PM.
Risks:
- A payroll can be performed on new company code without various information: financial accounting, CVR number, payment account, etc.
- General deletion of department in Emply is not synchronized.
Remember to update Security/Roles in Lessor PM, so the user has access to employees with any new Organization Codes.