Volume calculation error on shipment sheet

The volume stated on shipment sheets is not being calculated correctly. For example, when creating my shipment I enter 60cm, 80cm and 50cm for my package dimensions. This should result in 0.24 m3, but the volume shown at the bottom of the shipment sheet is 0.00024 m3.

What am I doing wrong ?

I think the system is working correctly. You are conflating two different units of length [cm & m] to obtain a volume.

60cm x 80cm x 50cm = 240000cm3

If you want your volume to be in m3 then your lengths need to be in meters not centimeters.

I hope that helps.

Frank

What ? See screenshots below of the shipment card and the resulting shipment sheet. It calculates the volume correctly on the shipment card (240 dm3), but the volume at the bottom of the shipment sheet is incorrect (0.00024 m3). It’s not converting between units correctly.

I shouldn’t have tried to answer your question without going into my Dolibarr installation and looking since I don’t use product measurements in my business application.

That said, you might try to go to the following:

Home/Setup/Dictionaries/Measuring Units

On that screen, you can edit the “Scale” which controls the placing of the decimal point. In my installation, the scale is -6 for CM3.

If you took the 240000 cm3 and moved the decimal -6, you would get 0.24m3

Hope that helps.

Frank

Thanks. The measuring units in my system have a scale of -6 for CM3, and no scale for M3. I’ve tried setting M3 to various values but all this achieves is the m3 disappearing from the “0.00024 m3” at the bottom of the shipment sheet. All I get is “0.00024”.

I think the problem is only in the espadon document template. How do you configure this template ?

Have you confirmed that the issue is only with the “espadon document” template?

I’m not conversant in template modifications but if that is the culprit, I would think that there is a bug in the code for that template.

Make a bug report and hope that the issue will be corrected.

Otherwise, you will need to dig into the code and resolve the issue yourself.

I wish I could help more.

Frank

I checked this on V 17.0.2 with template “espadon” out and the result is as expected:

My setup s as follows:

Thanks for checking. I’m using version 20.0.1 hosted on dolicloud.

In my setup there are no values in the sort order column. Will this make any difference ?

I also see that in your setup there is no value in the scale column for M3. Mine has the value 1, and gives an error if I try to leave it blank.

I’m still getting 0.00024 m3 instead of 240 dm3.

Have you tried another template, maybe a template from a version below (19/18/17.x.x) ?

I’m using a hosted installation so i don’t think I can switch between versions like that.