|
@@ -1707,7 +1707,6 @@ elseif ($id || $ref)
|
|
|
// Print form confirm
|
|
|
print $formconfirm;
|
|
|
|
|
|
-
|
|
|
// Calculate totalWeight and totalVolume for all products
|
|
|
// by adding weight and volume of each product line.
|
|
|
$tmparray=$object->getTotalWeightVolume();
|
|
@@ -1850,16 +1849,14 @@ elseif ($id || $ref)
|
|
|
else
|
|
|
{
|
|
|
print $object->trueWeight;
|
|
|
- print ($object->trueWeight && $object->weight_units!='')?' '.measuring_units_string(0, "weight", $object->weight_units):'';
|
|
|
+ print ($object->trueWeight && $object->weight_units!='')?' '.measuringUnitString(0, "weight", $object->weight_units):'';
|
|
|
}
|
|
|
|
|
|
// Calculated
|
|
|
if ($totalWeight > 0)
|
|
|
{
|
|
|
if (!empty($object->trueWeight)) print ' ('.$langs->trans("SumOfProductWeights").': ';
|
|
|
- //print $totalWeight.' '.measuring_units_string(0, "weight");
|
|
|
print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no');
|
|
|
- //if (empty($object->trueWeight)) print ' ('.$langs->trans("Calculated").')';
|
|
|
if (!empty($object->trueWeight)) print ')';
|
|
|
}
|
|
|
print '</td></tr>';
|
|
@@ -1867,7 +1864,7 @@ elseif ($id || $ref)
|
|
|
// Width
|
|
|
print '<tr><td>'.$form->editfieldkey("Width", 'trueWidth', $object->trueWidth, $object, $user->rights->expedition->creer).'</td><td colspan="3">';
|
|
|
print $form->editfieldval("Width", 'trueWidth', $object->trueWidth, $object, $user->rights->expedition->creer);
|
|
|
- print ($object->trueWidth && $object->width_units!='')?' '.measuring_units_string(0, "size", $object->width_units):'';
|
|
|
+ print ($object->trueWidth && $object->width_units!='')?' '.measuringUnitString(0, "size", $object->width_units):'';
|
|
|
print '</td></tr>';
|
|
|
|
|
|
// Height
|
|
@@ -1887,7 +1884,7 @@ elseif ($id || $ref)
|
|
|
else
|
|
|
{
|
|
|
print $object->trueHeight;
|
|
|
- print ($object->trueHeight && $object->height_units!='')?' '.measuring_units_string(0, "size", $object->height_units):'';
|
|
|
+ print ($object->trueHeight && $object->height_units!='')?' '.measuringUnitString(0, "size", $object->height_units):'';
|
|
|
}
|
|
|
|
|
|
print '</td></tr>';
|
|
@@ -1895,7 +1892,7 @@ elseif ($id || $ref)
|
|
|
// Depth
|
|
|
print '<tr><td>'.$form->editfieldkey("Depth", 'trueDepth', $object->trueDepth, $object, $user->rights->expedition->creer).'</td><td colspan="3">';
|
|
|
print $form->editfieldval("Depth", 'trueDepth', $object->trueDepth, $object, $user->rights->expedition->creer);
|
|
|
- print ($object->trueDepth && $object->depth_units!='')?' '.measuring_units_string(0, "size", $object->depth_units):'';
|
|
|
+ print ($object->trueDepth && $object->depth_units!='')?' '.measuringUnitString(0, "size", $object->depth_units):'';
|
|
|
print '</td></tr>';
|
|
|
|
|
|
// Volume
|
|
@@ -1915,15 +1912,13 @@ elseif ($id || $ref)
|
|
|
{
|
|
|
if ($volumeUnit < 50)
|
|
|
{
|
|
|
- //print $calculatedVolume.' '.measuring_units_string($volumeUnit, "volume");
|
|
|
print showDimensionInBestUnit($calculatedVolume, $volumeUnit, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no');
|
|
|
}
|
|
|
- else print $calculatedVolume.' '.measuring_units_string($volumeUnit, "volume");
|
|
|
+ else print $calculatedVolume.' '.measuringUnitString(0, "volume", $volumeUnit);
|
|
|
}
|
|
|
if ($totalVolume > 0)
|
|
|
{
|
|
|
if ($calculatedVolume) print ' ('.$langs->trans("SumOfProductVolumes").': ';
|
|
|
- //print $totalVolume.' '.measuring_units_string(0, "volume");
|
|
|
print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no');
|
|
|
//if (empty($calculatedVolume)) print ' ('.$langs->trans("Calculated").')';
|
|
|
if ($calculatedVolume) print ')';
|
|
@@ -2409,18 +2404,18 @@ elseif ($id || $ref)
|
|
|
|
|
|
// Weight
|
|
|
print '<td class="center linecolweight">';
|
|
|
- if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->weight*$lines[$i]->qty_shipped.' '.measuring_units_string(0, "weight", $lines[$i]->weight_units);
|
|
|
+ if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->weight*$lines[$i]->qty_shipped.' '.measuringUnitString(0, "weight", $lines[$i]->weight_units);
|
|
|
else print ' ';
|
|
|
print '</td>';
|
|
|
|
|
|
// Volume
|
|
|
print '<td class="center linecolvolume">';
|
|
|
- if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string(0, "volume", $lines[$i]->volume_units);
|
|
|
+ if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuringUnitString(0, "volume", $lines[$i]->volume_units);
|
|
|
else print ' ';
|
|
|
print '</td>';
|
|
|
|
|
|
// Size
|
|
|
- //print '<td class="center">'.$lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units, "volume").'</td>';
|
|
|
+ //print '<td class="center">'.$lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuringUnitString(0, "volume", $lines[$i]->volume_units).'</td>';
|
|
|
|
|
|
if ($action == 'editline' && $lines[$i]->id == $line_id)
|
|
|
{
|