diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 9ead4f64aac..836e7ffd0c7 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -379,7 +379,7 @@ if (empty($reshook))
if (! $error)
{
- $ret=$object->create($user); // This create shipment (like Odoo picking) and line of shipments. Stock movement will when validating shipment.
+ $ret=$object->create($user); // This create shipment (like Odoo picking) and lines of shipments. Stock movement will be done when validating shipment.
if ($ret <= 0)
{
setEventMessages($object->error, $object->errors, 'errors');
@@ -994,7 +994,7 @@ if ($action == 'create')
print '
';
print $langs->trans("Weight");
print ' ';
- $text=$formproduct->selectMeasuringUnits("weight_units", "weight", GETPOST('weight_units', 'int'));
+ $text=$formproduct->selectMeasuringUnits("weight_units", "weight", GETPOST('weight_units', 'int'), 0, 2);
$htmltext=$langs->trans("KeepEmptyForAutoCalculation");
print $form->textwithpicto($text, $htmltext);
print ' ';
@@ -1005,7 +1005,7 @@ if ($action == 'create')
print ' x ';
print ' x ';
print ' ';
- $text=$formproduct->selectMeasuringUnits("size_units", "size");
+ $text=$formproduct->selectMeasuringUnits("size_units", "size", GETPOST('size_units', 'int'), 0, 2);
$htmltext=$langs->trans("KeepEmptyForAutoCalculation");
print $form->textwithpicto($text, $htmltext);
print '';
@@ -2199,6 +2199,10 @@ elseif ($id || $ref)
$product_static->weight_units=$lines[$i]->weight_units;
$product_static->length=$lines[$i]->length;
$product_static->length_units=$lines[$i]->length_units;
+ $product_static->width=$lines[$i]->width;
+ $product_static->width_units=$lines[$i]->width_units;
+ $product_static->height=$lines[$i]->height;
+ $product_static->height_units=$lines[$i]->height_units;
$product_static->surface=$lines[$i]->surface;
$product_static->surface_units=$lines[$i]->surface_units;
$product_static->volume=$lines[$i]->volume;
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 16b08a8c183..0c340bc8695 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -324,8 +324,8 @@ class Expedition extends CommonObject
$sql.= ", ".$this->sizeS; // TODO Should use this->trueDepth
$sql.= ", ".$this->sizeW; // TODO Should use this->trueWidth
$sql.= ", ".$this->sizeH; // TODO Should use this->trueHeight
- $sql.= ", ".($this->weight_units>0?$this->weight_units:'NULL');
- $sql.= ", ".($this->size_units>0?$this->size_units:'NULL');
+ $sql.= ", ".($this->weight_units != '' ? (int) $this->weight_units : 'NULL');
+ $sql.= ", ".($this->size_units != '' ? (int) $this->size_units : 'NULL');
$sql.= ", ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ", ".(!empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ", ".(!empty($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null");
diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php
index 5ac2464995a..9c02fc35d16 100644
--- a/htdocs/product/canvas/product/actions_card_product.class.php
+++ b/htdocs/product/canvas/product/actions_card_product.class.php
@@ -181,19 +181,19 @@ class ActionsCardProduct
// Weight
$this->tpl['weight'] = $this->object->weight;
- $this->tpl['weight_units'] = $formproduct->selectMeasuringUnits("weight_units", "weight", $this->object->weight_units);
+ $this->tpl['weight_units'] = $formproduct->selectMeasuringUnits("weight_units", "weight", $this->object->weight_units, 0, 2);
// Length
$this->tpl['length'] = $this->object->length;
- $this->tpl['length_units'] = $formproduct->selectMeasuringUnits("length_units", "size", $this->object->length_units);
+ $this->tpl['length_units'] = $formproduct->selectMeasuringUnits("length_units", "size", $this->object->length_units, 0, 2);
// Surface
$this->tpl['surface'] = $this->object->surface;
- $this->tpl['surface_units'] = $formproduct->selectMeasuringUnits("surface_units", "surface", $this->object->surface_units);
+ $this->tpl['surface_units'] = $formproduct->selectMeasuringUnits("surface_units", "surface", $this->object->surface_units, 0, 2);
// Volume
$this->tpl['volume'] = $this->object->volume;
- $this->tpl['volume_units'] = $formproduct->selectMeasuringUnits("volume_units", "volume", $this->object->volume_units);
+ $this->tpl['volume_units'] = $formproduct->selectMeasuringUnits("volume_units", "volume", $this->object->volume_units, 0, 2);
}
if ($action == 'view')
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index abee5f8a678..0ba41e651fc 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1120,7 +1120,7 @@ else
// Net Measure
print ''.$langs->trans("NetMeasure").' ';
print ' ';
- print $formproduct->selectMeasuringUnits("net_measure_units", '', GETPOSTISSET('net_measure_units')?GETPOST('net_measure_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), '');
+ print $formproduct->selectMeasuringUnits("net_measure_units", '', GETPOSTISSET('net_measure_units')?GETPOST('net_measure_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 0);
print ' ';
}
}
@@ -1503,7 +1503,7 @@ else
// Net Measure
print ''.$langs->trans("NetMeasure").' ';
print ' ';
- print $formproduct->selectMeasuringUnits($object->net_measure_units, '');
+ print $formproduct->selectMeasuringUnits($object->net_measure_units, '', 0, 0, 0);
print ' ';
}
}
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 8545036b0b9..b49dfd04902 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -256,18 +256,23 @@ class Product extends CommonObject
*/
public $url;
- //! Unites de mesure
- public $net_measure;
- public $net_measure_units;
+ //! Metric of products
public $weight;
public $weight_units;
public $length;
public $length_units;
+ public $width;
+ public $width_units;
+ public $height;
+ public $height_units;
public $surface;
public $surface_units;
public $volume;
public $volume_units;
+ public $net_measure;
+ public $net_measure_units;
+
public $accountancy_code_sell;
public $accountancy_code_sell_intra;
public $accountancy_code_sell_export;
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 9d2ae9b8c17..13eb53d86a6 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -833,7 +833,7 @@ if ($action == 'create')
print '';
print $langs->trans("Weight");
print ' ';
- $text=$formproduct->selectMeasuringUnits("weight_units", "weight", GETPOST('weight_units', 'int'));
+ $text=$formproduct->selectMeasuringUnits("weight_units", "weight", GETPOST('weight_units', 'int'), 0, 2);
$htmltext=$langs->trans("KeepEmptyForAutoCalculation");
print $form->textwithpicto($text, $htmltext);
print ' ';
@@ -844,7 +844,7 @@ if ($action == 'create')
print ' x ';
print ' x ';
print ' ';
- $text=$formproduct->selectMeasuringUnits("size_units", "size");
+ $text=$formproduct->selectMeasuringUnits("size_units", "size", GETPOST('size_units', 'int'), 0, 2);
$htmltext=$langs->trans("KeepEmptyForAutoCalculation");
print $form->textwithpicto($text, $htmltext);
print '';
@@ -1444,7 +1444,7 @@ elseif ($id || $ref)
print ' ';
print ' ';
print ' ';
- print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units);
+ print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2);
print ' ';
print ' ';
print '';
@@ -1472,14 +1472,14 @@ elseif ($id || $ref)
// Height
print ''.$form->editfieldkey("Height", 'trueHeight', $object->trueHeight, $object, $user->rights->reception->creer).' ';
- if($action=='edittrueHeight')
+ if ($action=='edittrueHeight')
{
print '';
@@ -1786,8 +1786,6 @@ elseif ($id || $ref)
print ' ';
-
-
$text=$lines[$i]->product->getNomUrl(1);
$text.= ' - '.$label;
$description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($lines[$i]->product->description));