Deputy logoAFAS Profit logo

Leave, absence and time

Deputy to AFAS integration: approved timesheets to the payroll run, employees and leave balance back

With an integration between Deputy and AFAS Profit, timesheets approved for payroll in Deputy go to AFAS automatically, per pay component and per employment, ready for the payroll run. In the other direction new employees, location and leave balance come from AFAS into Deputy, so scheduling rosters the people who are actually employed.

What the integration does

Employers that schedule in Deputy and run payroll in AFAS Profit export the timesheets after every period, convert the Deputy codes to AFAS pay components and import the file. Meanwhile a manager in Deputy can still change a shift that has already been paid, and new employees are created separately in both packages.

  1. HR records a new employee in AFAS with employment, job and organisational unit.
  2. KoppelHet creates the employee in Deputy, at the location that belongs to the organisational unit, with the AFAS employee number as payroll ID.
  3. Employees clock in and out in Deputy. The manager first approves the time and then the pay.
  4. After pay approval KoppelHet retrieves the hours per pay rule and books them in AFAS on the pay component that matches the export code.
  5. Once AFAS has accepted the lines, KoppelHet marks the timesheets as paid in Deputy. After that they can no longer be changed there.
Deputy → KoppelHet → AFAS ProfitSOURCEDeputyTARGETAFAS ProfitKoppelHetmapping · logging · monitoringDeputy → KoppelHet → AFAS ProfitSOURCEDeputyTARGETAFAS ProfitKoppelHetmapping · logging · monitoring
Out: Employee with primary location and start date · Payroll ID per employment · Leave balance per leave type · Paid status in Deputy
Back: Worked hours per export code as payroll change · Premium hours from Deputy's pay rules

What to watch for with Deputy and AFAS Profit

  • Deputy has two approvals on a timesheet, one for time and one for pay. A timesheet can be approved for time while pay is still open. The integration only books in AFAS after the second approval, because only then does Deputy fix the pay lines.
  • Every pay rule in Deputy has a payroll export code and a flag saying whether it is exported. That code must match a pay component in AFAS. Before the first payroll run KoppelHet checks that every export code has a pay component, and reports a line without a match instead of skipping it.
  • A timesheet marked as paid in Deputy is locked. KoppelHet only sets that status after AFAS has accepted the hours. A manager can then no longer change a shift that is already in the payroll run, and a timesheet that AFAS rejected stays editable.
  • Deputy only marks timesheets as paid one pay period at a time; if a single timesheet from another period is included, the whole call fails. KoppelHet therefore groups the timesheets per Deputy period before the status goes back.
  • A new leave balance in Deputy replaces the old one, it is not added to it. KoppelHet therefore always sends the full balance from AFAS per leave type, never just that week's usage.
  • Deputy attaches the payroll ID to the agreement per location, not to the person. If someone has two employments in AFAS, for example at two companies in the same environment, each employment gets its own agreement and the hours land on the right employment.
  • AFAS can book hours in the period of the shift or in the current payroll run. Shifts that are approved in Deputy after closing are booked by KoppelHet according to the method your payroll team uses, so no period is counted twice or left empty.

How we build and run it

  • The integration runs on the KoppelHet platform, hosted in a data centre in the EU.
  • Every sync and every error is visible in the functional log; on an error your administrator is notified.
  • A change that cannot go through is not half-applied but queued for another attempt.
  • KoppelHet is ISO 27001 certified. Data travels encrypted and stays on the platform no longer than needed.
  • After go-live we manage the integration and adjust it when your process changes.
  • The integration fits next to your existing integration layer. Only the fields in the design are transferred; the platform keeps no register of its own.

Implementation, architecture and compliance

Implementation and price

This is not an app you switch on. We build the integration for your organisation on our platform, with building blocks we reuse on every project. So it is custom work that does not start from scratch.

A consultant prepares the intake and analyses both systems. We then record the mapping and exceptions field by field, test in the test or acceptance environment and go live at a moment you choose. Costs are a one-off amount for the setup and a monthly amount for platform, monitoring and support.

Price indication · Basic

Leave your work email and you see the price indication right away.

We only use your address to follow up on your question about this integration.

Frequently asked questions

Does Deputy or AFAS calculate the premiums?

Deputy calculates per shift with pay rules. The integration takes that result per export code. If AFAS also calculates premiums on the same hours, we agree beforehand which side leads, otherwise people are paid twice.

What happens with a correction after the payroll run?

A paid timesheet is locked in Deputy. If it still needs a change, payroll sets it back to unpaid; the integration then books only the difference in AFAS.

Are leave requests included too?

The balance is included by default. Putting approved leave from AFAS into Deputy as absence can be added later as an extension.

Technical details for IT

For those who want to know how it works under the hood: APIs, fields and sources used.

  • Hours come from the Deputy resources Timesheet and TimesheetPayReturn (QUERY, by default at most 500 records per call). Timesheet contains TimeApproved and PayRuleApproved; TimesheetPayReturn returns Value (hours) and Cost per PayRule, only for timesheets approved for payroll.
  • Deputy webhooks report, among other things, time approval and pay approval, signed with a SHA-256 HMAC in the X-Deputy-Secret header. Marking as paid uses payroll/mark/{periodid}/paid with a TimesheetIdArray; reversing uses /unpaid.
  • Employees go to Deputy through the Employee API v2 (management/v2/employees) with firstName, lastName, displayName, primaryLocation, startDate, externalId and workplaces[].agreement.payrollId. Leave balances through the LeaveAccrual resource, which overwrites the balance.
  • In AFAS we write payroll changes through the UpdateConnector HrCompMut; parameters (VaD1-3) only when they are set up on the pay component. AFAS is read with a dedicated GetConnector on employees, employments and organisational units.

Which fields are transferred

The key fields. The full mapping is agreed per customer.

Field in DeputyField in AFAS ProfitNotes
Employee (Deputy-id)Medewerker (EmId)Through the payroll ID the integration sets when creating the employee in Deputy
workplaces[].agreement.payrollIdPersoneelsnummer en dienstverband in AFASEach employment its own agreement in Deputy
primaryLocationOrganisatorische eenheidThrough a table from units to Deputy locations
PayRule.PayrollCategory (exportcode)Looncomponent in HrCompMutOnly pay rules with IsExported
TimesheetPayReturn.ValueAantal uren in de loonmutatie
Timesheet.StartTimePeriode van de loonmutatiePer the chosen method: period of the shift or current run
Verlofsaldo uit AFASLeaveAccrualAlways the full balance, Deputy overwrites

Related

Which systems do you want to connect?

Tell us which systems you use and what should happen automatically. Together we define the smallest working solution, with a clear design and a quote before building.