AFAS Profit is business software used by many Dutch firms for their financial administration. If your firm books through AFAS, you can connect it to Legalsense so debtor, matter, and invoice information flows between the two systems automatically. This article explains how to set up the integration.
Note: After setup, see the article ↪ Managing the integration with accounting software to monitor the synchronization, review the sync queue, and change the ledger and trust account configuration.
In this article
How the integration works
The integration between Legalsense and AFAS works both ways:
- Legalsense sends debtors, matters, invoices, and credit invoices to AFAS. Debtors become sales relations (organizations or persons), matters become allocation codes on an allocation axis (verbijzonderingsas) of your choice, and invoices become entries in your sales journal, with the invoice PDF attached as a dossier item if you choose.
- Legalsense retrieves payments and outstanding amounts on invoices, creditors, purchase invoices booked on a disbursement ledger account (which become disbursements on the matter), and trust accounting transactions.
Legalsense synchronizes automatically every 12 minutes. Changes to debtors and matters are sent on the next sync, and an invoice is sent as soon as you finalize it, together with its debtor and matter if they haven't been sent yet.
Important: Legalsense sends an invoice to AFAS only once. If you need to correct an invoice after it has been synchronized, create a credit invoice. See the article ↪ Creating a credit invoice.
Before you start
The AFAS integration has to be activated for your environment by Legalsense. If Settings → AFAS isn't available, contact Legalsense support.
In general, users linked to the sync accounting group in Legalsense (with the manage_sync_accounting permission) can set up and manage the integration. We advise involving your bookkeeper, accountant, or AFAS consultant, because several things need to be prepared in AFAS Profit first.
Prepare AFAS Profit
Make sure the following is in place in AFAS Profit before you start:
-
An App Connector for Legalsense, with an AFAS token. The App Connector must contain the connectors below. Legalsense checks this when you save the connection, and lists any that are missing. Several of them are specific to Legalsense; contact Legalsense support for their definitions.
-
UpdateConnectors: KnSalesRelationOrg, KnSalesRelationPer, FiEntries, KnSubject, KnDimCode
- GetConnectors: Profit_Accounts, Profit_Creditor, Profit_Subject_Attachments, Profit_VAT_code, Legalsense_Cost_Centers, Legalsense_Creditor_Invoices, Legalsense_Outstanding_Amount, Legalsense_Subjects, Legalsense_Transactions
- An allocation axis for matters. Choose which of the five allocation axes (1 to 5) Legalsense uses for matters.
- The administration numbers for your regular bookkeeping and for trust accounting. These can be the same administration.
- A debtors collective account with the description Debiteuren. Legalsense books new debtors on this account.
- Your chart of accounts, VAT codes, journals, and cost centers, so you can map them in Legalsense.
You also need your AFAS environment number (in AFAS, this is your subscription number, the Online Member Number), and the email address of the person who should be notified when the synchronization fails.
Check your data in Legalsense
AFAS requires a complete address for every debtor. Before you start, check that your debtors have a billing address with a street name and house number, a postal code, and a city.
When the AFAS integration is active, the Billing reference on a matter's debtor must be empty, or contain between 6 and 32 letters or digits. It may only contain letters, digits, spaces, dots, colons, hyphens, and slashes.
Set up the integration
Go to Settings → AFAS → Overview and click Set up AFAS now. Until the integration is set up, the overview shows the status Inactive.
AFAS overview page before setup, showing the status Inactive and the Set up AFAS now button.
- In the AFAS configuration step, fill in the connection details. All fields are required.
- AFAS Environment ID*: your AFAS environment number, digits only.
- AFAS token*: the token of the App Connector for Legalsense.
- Matter allocation axis id*: the allocation axis (1 to 5) Legalsense uses for matters.
- Administration id*: the administration Legalsense books invoices and payments in.
- Trust accounting administration id*: the administration Legalsense reads trust accounting transactions from.
AFAS setup, AFAS configuration step, showing the environment ID, token, allocation axis, and administration fields.
Click Next. Legalsense connects to AFAS and checks the token and the App Connector. If something is wrong, an error appears above the form. See Troubleshooting below. 2. Enter the Email of the Administrator*: the address that receives a notification when the synchronization fails. Separate multiple addresses with a comma. Click Next. 3. In the Import and export step, choose which data Legalsense sends and retrieves, then click Next. See Import and export options below.
AFAS setup, Import and export step, showing the options for matters and debtors, payment status, and expenses and creditors.
- In the Ledger accounts step, choose Customize the ledger accounts and enter the AFAS ledger account, VAT code, journal, or cost center for each row. While you type, Legalsense suggests the data from your AFAS administration. Click Next.
Important: The Legalsense default ledger accounts are generic suggestions and usually don't match your chart of accounts in AFAS. Check every row with your bookkeeper. See the article ↪ Managing the integration with accounting software for what each section is for.
- In the Revenue accounts per user step, choose No accounts per lawyer, or Specific ledger accounts or cost centers per lawyer to book each timekeeper's revenue to their own ledger accounts or cost center. Click Next.
- In the Accounts for disbursement types step, choose No overrides, or Specific accounts per expense type to book a disbursement type to its own ledger account. Click Next.
Legalsense then returns to the overview. The setup doesn't start the synchronization: contact Legalsense support to start it. Once it runs, the overview shows its status, the last successful sync, and the number of elements in the queue.
AFAS overview page after setup, showing the status, email of the administrator, and number of elements in the queue.
Note: Legalsense doesn't send all your existing debtors and matters to AFAS in one go. A debtor or matter is sent the first time it changes, or when you finalize an invoice for it.
Import and export options
The field marked with an asterisk (*) is required when you choose to import expenses.
Troubleshooting
Could not connect to environment. Please check the provided environment ID
Legalsense can't reach an AFAS environment with this number. Check the AFAS Environment ID: it must be your AFAS environment number, digits only.
Verification failed. Please check the provided combination of environment ID and token.
The environment was found, but AFAS rejected the token. Check that you copied the complete token of the App Connector for Legalsense, and that the token belongs to this environment.
Missing getConnectors: … / Missing updateConnectors: …
The App Connector doesn't contain all the connectors Legalsense needs. Add the listed connectors to the App Connector in AFAS Profit, then click Next again. Contact Legalsense support if you don't have the definitions of the Legalsense_ connectors.
The synchronization stopped with an error about a debtor.
AFAS rejects debtors without a complete address. The most common messages are:
After fixing the cause, click Error fixed on the error page. Legalsense then tries again. See the article ↪ Managing the integration with accounting software for the other errors, such as an unknown VAT code.
This Legalsense installation is currently not authenticated with AFAS.
The AFAS token is no longer valid, for example because it was revoked in AFAS. Create a new token for the App Connector, go to Settings → AFAS, and enter the new token in the AFAS configuration step.
Comments
0 comments
Please sign in to leave a comment.