How to use a contract for a product with unique serial number

We are building physical products that we sell together with a time-based service plan. Right now we are using Dolibarr to manufacture the products, create invoices, track stock etc.

I would like to also handle the service plans in Dolibarr and took a look at the “Contracts/Subscriptions” module.
The product that we sell has a unique serial number (we use the “Product Lots” module for that).

Ideally, I would like to create a contract with several licenses and connect each license to a unique serial number.

Contract 1:

  • Plan A for Serial Number X (Runtime 1.1.2025-31.12.2025) - 1000€
  • Plan B for Serial Number Y (Runtime 1.1.2025-31.6.2025) - 700€

How would I approach this in Dolibarr? I see that I can create “Complementary attributes” in the contract setup. Maybe it is possible to allow only valid serial-numbers in this field. But I think I need this attribute on the level of a plan (=a service in Dolibarr) inside a contract.

Any ideas how to approach this are much appreciated :slight_smile:

you could make an complementary attribute field that looked in a database of licenses.

Another idea might be to create a field which has a regex pattern matched to it, but that requires PHP code.

Thanks for your suggestion! But as I understand it, I can only create this complementary attribute on the contract itself - right? But logically it is an attribute of each service (our plan) inside the contract.

If I add this complementary attribute to services, it will be shown for each service and not only my plan service. Or do I misunderstand the concept? Is there any documentation for it?

You can make Complementary Attributes on at least proposals and proposal lines, as well as on order and order lines, and finally on invoice and invoice lines.

I do not know about Contracts because I don’t use them.

Hi,
I confirm that contracts have complementary attributes also for lines

OK. I will take a look at that. Thanks!