1. Help Center
  2. WooCommerce Uniconta

Customers / Debtors

This document aims to describe the synchronization of customers/debtors in the plugin.

You can configure the mapping in the configuration page of the plugin on the tab Mapping and the sub tab users:

Special consideration have to be taken if you decide to use an user fields xDebtorActive in Uniconta.

Synchronization from Uniconta

When Synchronizing a Debtor from Uniconta, the system will look for a previous synchronization that occurred. If none is found then the system will try to find the closest match to the debtor by using the ContactEmail or InvoiceEmail when ContactEmail is not available; if a customer with the same email is found then it's considered as a match of the debtor and then the data will be updated. if no match or link is found then a new customer will be created in Wordpress.

An Email is necessary to create a user in wordpress so a proper email needs to be set in either the ContactEmail or the InvoiceEmail or the debtor will not be created. In the case an xDebtorActive field is present, if that field value is false, then the user creation will not happen, otherwise it will proceed. In the case a previous synchronization have been done and the new value of the xDebtorActive is set to false then the User will be blocked in wordpress by having is role set to "no role for this site".

User not created because the xDebtorActive is set to false

The user_login defaults to the Debtor Name but it could be overrided in the mapping by setting it to the value desired from Uniconta.

Synchronization from wordpress

The synchronization of an user from wordpress happens when the user is saved in wordpress and triggered by the wordpress actions user_register and profile_update. When the user is created and send to Uniconta, a link is sought first, if none is found then the system looks for a debtor having the same ContactEmail or InvoiceEmail. if none is found the system looks for a debtor with the same automatically generated Account in Debtor. The format of this generated account is a 5 digits number with the user id preceded by 0. So a new user with id 10 will have a generated account 00010.

If still no link can be establish, the debtor is created in Uniconta and the xDebtorActive field is set to true if it exists.

Of course the users who do not have any role ( blocked ) are not synchronized when updated even by an administrator. ( In a future release, setting no roles to the user in wordpress will set the xDebtorActive field to false in Uniconta )

Starting with version 3.1.5 you can disable the sync of the users from wordpress on the main configuration page. Unchecking it will make it so the customers created in Wordpress will not be created as debtor in Uniconta.

Default Payment Term

You can select a default payment term that will be set when the debtor is created in Uniconta.

That will be done only on creation, not on update.