mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX Pb in units of shipments
This commit is contained in:
parent
866dcf18fe
commit
5297ab4ab4
|
|
@ -93,7 +93,6 @@ $extrafields = new ExtraFields($db);
|
|||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
|
||||
|
||||
// Load object. Make an object->fetch
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
|
||||
|
|
@ -1573,8 +1572,9 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Line extrafield
|
||||
if (!empty($extrafields))
|
||||
if (! empty($extrafields))
|
||||
{
|
||||
//var_dump($line);
|
||||
$colspan=5;
|
||||
$extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$srcLine = new OrderLine($db);
|
||||
|
|
@ -1839,8 +1839,8 @@ elseif ($id || $ref)
|
|||
print '<input name="action" value="settrueWeight" type="hidden">';
|
||||
print '<input name="id" value="'.$object->id.'" type="hidden">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input id="trueWeight" name="trueWeight" value="'.$object->trueWeight.'" type="text">';
|
||||
print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units);
|
||||
print '<input id="trueWeight" name="trueWeight" value="'.$object->trueWeight.'" type="text" class="width50">';
|
||||
print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2);
|
||||
print ' <input class="button" name="modify" value="'.$langs->trans("Modify").'" type="submit">';
|
||||
print ' <input class="button" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
|
||||
print '</form>';
|
||||
|
|
@ -1848,7 +1848,7 @@ elseif ($id || $ref)
|
|||
else
|
||||
{
|
||||
print $object->trueWeight;
|
||||
print ($object->trueWeight && $object->weight_units!='')?' '.measuring_units_string($object->weight_units, "weight"):'';
|
||||
print ($object->trueWeight && $object->weight_units!='')?' '.measuring_units_string(0, "weight", $object->weight_units):'';
|
||||
}
|
||||
|
||||
// Calculated
|
||||
|
|
@ -1865,7 +1865,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($object->width_units, "size"):'';
|
||||
print ($object->trueWidth && $object->width_units!='')?' '.measuring_units_string(0, "size", $object->width_units):'';
|
||||
print '</td></tr>';
|
||||
|
||||
// Height
|
||||
|
|
@ -1876,8 +1876,8 @@ elseif ($id || $ref)
|
|||
print '<input name="action" value="settrueHeight" type="hidden">';
|
||||
print '<input name="id" value="'.$object->id.'" type="hidden">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input id="trueHeight" name="trueHeight" value="'.$object->trueHeight.'" type="text">';
|
||||
print $formproduct->selectMeasuringUnits("size_units", "size", $object->size_units);
|
||||
print '<input id="trueHeight" name="trueHeight" value="'.$object->trueHeight.'" type="text" class="width50">';
|
||||
print $formproduct->selectMeasuringUnits("size_units", "size", $object->size_units, 0, 2);
|
||||
print ' <input class="button" name="modify" value="'.$langs->trans("Modify").'" type="submit">';
|
||||
print ' <input class="button" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
|
||||
print '</form>';
|
||||
|
|
@ -1885,7 +1885,7 @@ elseif ($id || $ref)
|
|||
else
|
||||
{
|
||||
print $object->trueHeight;
|
||||
print ($object->trueHeight && $object->height_units!='')?' '.measuring_units_string($object->height_units, "size"):'';
|
||||
print ($object->trueHeight && $object->height_units!='')?' '.measuring_units_string(0, "size", $object->height_units):'';
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
|
@ -1893,7 +1893,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($object->depth_units, "size"):'';
|
||||
print ($object->trueDepth && $object->depth_units!='')?' '.measuring_units_string(0, "size", $object->depth_units):'';
|
||||
print '</td></tr>';
|
||||
|
||||
// Volume
|
||||
|
|
@ -2100,7 +2100,6 @@ elseif ($id || $ref)
|
|||
}
|
||||
print "</tr>\n";
|
||||
print '</thead>';
|
||||
$var=false;
|
||||
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
|
||||
{
|
||||
|
|
@ -2408,13 +2407,13 @@ 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($lines[$i]->weight_units, "weight");
|
||||
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);
|
||||
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($lines[$i]->volume_units, "volume");
|
||||
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);
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user