-->
Welcome, Guest
Username: Password: Remember me

TOPIC: Severe Problem with calculated Weight and volume

Severe Problem with calculated Weight and volume 1 week 2 days ago #38452

Dear Concern,

Today I am facing a severe problem with the calculated weight and volume, anyone also faced this panic situation.

Screenshotfrom2019-09-1216-31-44.png


How to get rid of these weight and volume big numbers.?

Any help would be much appreciated.
Kind Regards,
Adnan
Last Edit: 1 week 2 days ago by adnanbutt050.
The administrator has disabled public write access.

Severe Problem with calculated Weight and volume 1 week 2 days ago #38453

  • ksar
  • ksar's Avatar
  • OFFLINE
  • Moderator
  • Posts: 322
  • Thank you received: 86
  • Karma: 14
Hi,

With only that little information it will be difficult to help.
The administrator has disabled public write access.

Severe Problem with calculated Weight and volume 5 days 10 hours ago #38475

Then Which information I can show here, let me know I will post over here
The administrator has disabled public write access.

Severe Problem with calculated Weight and volume 5 days 7 hours ago #38478

  • dolibarr95
  • dolibarr95's Avatar
  • OFFLINE
  • Junior
  • Posts: 29
  • Thank you received: 3
  • Karma: 0
Hello :)
since it upgrade to dolibarr 10 (from 6) all my weight are in wrong unit (kg instead of g)
The administrator has disabled public write access.

Severe Problem with calculated Weight and volume 1 day 1 hour ago #38504

  • simicar
  • simicar's Avatar
  • OFFLINE
  • Newcomer
  • Posts: 3
  • Thank you received: 2
  • Karma: 1
Problem comes from the function getTotalWeightVolume in core/class/commonobject.class.php uses unit index instead of dictionary 'scale' to convert values.
(issue filed as github.com/Dolibarr/dolibarr/issues/11861)
If you feel like changing the code, find the lines

$weightUnit=0;
$volumeUnit=0;
if (! empty($weight_units)) $weightUnit = $weight_units;
if (! empty($volume_units)) $volumeUnit = $volume_units;

if (empty($totalWeight)) $totalWeight=0; // Avoid warning because $totalWeight is ''
if (empty($totalVolume)) $totalVolume=0; // Avoid warning because $totalVolume is ''

and change them to :
$weightUnit=0;
$volumeUnit=0;
if (! empty($weight_units)) $weightUnit = getDictvalue(MAIN_DB_PREFIX.'c_units', 'scale', $weight_units);
if (! empty($volume_units)) $volumeUnit = getDictvalue(MAIN_DB_PREFIX.'c_units', 'scale', $volume_units);

if (empty($totalWeight)) $totalWeight=0; // Avoid warning because $totalWeight is ''
if (empty($totalVolume)) $totalVolume=0; // Avoid warning because $totalVolume is ''

Kindest regards,
Marc
The administrator has disabled public write access.
Time to create page: 0.069 seconds