2
0
forked from Wavyzz/dolibarr

FIX #11861 Not consistent code to manage measuring units

This commit is contained in:
Laurent Destailleur
2019-09-27 19:45:33 +02:00
parent 18055bc425
commit d0d884742f
7 changed files with 67 additions and 45 deletions

View File

@@ -4522,7 +4522,7 @@ function price2num($amount, $rounding = '', $alreadysqlnb = 0)
* Output a dimension with best unit
*
* @param float $dimension Dimension
* @param int $unit Unit of dimension (Example: 0=kg, -3=g, 98=ounce, 99=pound, ...)
* @param int $unit Unit scale of dimension (Example: 0=kg, -3=g, -6=mg, 98=ounce, 99=pound, ...)
* @param string $type 'weight', 'volume', ...
* @param Translate $outputlangs Translate language object
* @param int $round -1 = non rounding, x = number of decimal
@@ -4566,7 +4566,7 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round
$unit = $forceunitoutput;
}*/
$ret=price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string($unit, $type);
$ret=price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string(0, $type, $unit);
return $ret;
}