diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index eab61660621..36372230301 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -124,7 +124,7 @@ class Reception extends CommonObject */ public $trueWeight; /** - * @var null|float|int + * @var int */ public $weight_units; /** @@ -152,11 +152,11 @@ class Reception extends CommonObject */ public $depth_units; /** - * @var int|float|''|null A denormalized value + * @var int|float|string|null A denormalized value */ public $trueSize; /** - * @var int|string + * @var int */ public $size_units; /** @@ -350,8 +350,8 @@ class Reception extends CommonObject $sql .= ", ".(is_null($this->trueDepth) ? "NULL" : ((float) $this->trueDepth)); $sql .= ", ".(is_null($this->trueWidth) ? "NULL" : ((float) $this->trueWidth)); $sql .= ", ".(is_null($this->trueHeight) ? "NULL" : ((float) $this->trueHeight)); - $sql .= ", ".(is_null($this->weight_units) ? "NULL" : ((float) $this->weight_units)); - $sql .= ", ".(is_null($this->size_units) ? "NULL" : ((float) $this->size_units)); + $sql .= ", ".((int) $this->weight_units); + $sql .= ", ".((int) $this->size_units); $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"); @@ -1323,10 +1323,10 @@ class Reception extends CommonObject $this->trueHeight = price2num($this->trueHeight); } if (isset($this->size_units)) { - $this->size_units = trim((string) $this->size_units); + $this->size_units = (int) $this->size_units; } if (isset($this->weight_units)) { - $this->weight_units = (float) trim((string) $this->weight_units); + $this->weight_units = (int) $this->weight_units; } if (isset($this->trueWeight)) { $this->weight = price2num($this->trueWeight); @@ -1360,12 +1360,12 @@ class Reception extends CommonObject $sql .= " fk_shipping_method=".((isset($this->shipping_method_id) && $this->shipping_method_id > 0) ? $this->shipping_method_id : "null").","; $sql .= " tracking_number=".(isset($this->tracking_number) ? "'".$this->db->escape($this->tracking_number)."'" : "null").","; $sql .= " fk_statut=".(isset($this->statut) ? $this->statut : "null").","; - $sql .= " height=".(($this->trueHeight != '') ? $this->trueHeight : "null").","; - $sql .= " width=".(($this->trueWidth != '') ? $this->trueWidth : "null").","; - $sql .= " size_units=".(isset($this->size_units) ? $this->size_units : "null").","; - $sql .= " size=".(($this->trueDepth != '') ? $this->trueDepth : "null").","; - $sql .= " weight_units=".(isset($this->weight_units) ? $this->weight_units : "null").","; - $sql .= " weight=".(($this->trueWeight != '') ? $this->trueWeight : "null").","; + $sql .= " height=".(($this->trueHeight != '') ? (float) $this->trueHeight : "null").","; + $sql .= " width=".(($this->trueWidth != '') ? (float) $this->trueWidth : "null").","; + $sql .= " size_units=".((int) $this->size_units).","; + $sql .= " size=".(($this->trueDepth != '') ? (float) $this->trueDepth : "null").","; + $sql .= " weight_units=".((int) $this->weight_units).","; + $sql .= " weight=".(($this->trueWeight != '') ? (float) $this->trueWeight : "null").","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; $sql .= " model_pdf=".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null").",";