The cost of a service in a bill of materials is 3,600 times too high

A 10-minute service on a €30/h workstation should cost €5, and the bill of materials line shows €18,000. One reproduced cause: the short label of the hour in the units dictionary.

Versions concerned
Dolibarr 20 to 24 · tested in 20.0.4 and 24.0.1 · same code in 24.0.2 and in the development branch
What was checked
Tested on 4 October 2026 on 20.0.4 and 24.0.1 instances: €30/h workstation, 10-minute service; line at €5.10 and total at €5.00 with the original dictionary; line at €18,000.00 and total still at €5.00 as soon as the hour's short label becomes "hr"; €5.10 once "h" was put back, through the dictionary screen. Bill of materials screen (bom/tpl/objectline_view.tpl.php) and unit conversion (core/class/cunits.class.php) read in the official code from 20.0.4 to 24.0.2 and in the development branch.

In a bill of materials (BOM module), you add a service: 10 minutes on a workstation that costs €30 an hour. The expected cost is €5. The line shows €18,000. Yet the total manufacturing cost of the bill of materials is right.

18,000 is 600 × 30: the 10 minutes were counted in seconds instead of being converted into hours.

The cause we reproduced

To convert a line’s duration into hours, the bill of materials screen looks for the “hour” unit in the units dictionary by its short label, which must be h. If it does not find it, it converts nothing: the duration stays in seconds, then it is multiplied by the hourly rate.

The total cost, for its part, is computed another way, which does not depend on this label. That is why the total stays right while the line is wrong.

What to check

  1. Go to HomeSetupDictionariesMeasuring Units.
  2. Find the hour row (code H, type time).
  3. Its short label must be h. If someone changed it, for example to hr, put h back.

The bill of materials line then shows the right amount.

If the label is already h and the amount is still wrong, the cause is elsewhere: this note describes the only cause we reproduced, not the only possible one.

Why €5.10 and not €5

Once the conversion works, you will probably see €5.10 and not €5. The unit conversion rounds the result to two decimals: 10 minutes become 0.17 hours, and 0.17 × 30 = 5.10. This difference only affects the line display: the total shows €5.00.

How this was verified

  • On 20.0.4 and 24.0.1 test instances, with a €30/h workstation and a 10-minute service: line at €5.10 and total at €5.00 with the original dictionary; line at exactly €18,000.00 and total still at €5.00 with the short label changed to hr; €5.10 again once h was put back through the dictionary screen.
  • In the official code, the line screen looks for the hour by its short label from 20.0.4 to 24.0.2, and still in the development branch.

If your manufacturing costs are still wrong

If the costs of your bills of materials or manufacturing orders do not match what you expect, the €90 diagnosis is about going through one case with you for one hour, then giving you in writing the cause and what the fix would cost.

Dolibarrbill of materialsBOMcostserviceworkstationmeasuring units