diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ee798581feb..dc4838a9cfd 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3844,14 +3844,25 @@ class Product extends CommonObject $label .= '
' . $langs->trans('ProductLabel') . ': ' . $this->label; } - if ($this->type == Product::TYPE_PRODUCT) { - if ($this->weight) { $label.="
".$langs->trans("Weight").': '.$this->weight.' '.measuring_units_string($this->weight_units, "weight"); + if ($this->type == Product::TYPE_PRODUCT) + { + if ($this->weight) { + $label.="
".$langs->trans("Weight").': '.$this->weight.' '.measuring_units_string($this->weight_units,"weight"); } - if ($this->length) { $label.="
".$langs->trans("Length").': '.$this->length.' '.measuring_units_string($this->length_units, 'length'); + if ($this->length) { + $label.="
".$langs->trans("Length").': '.$this->length.' '.measuring_units_string($this->length_units,'size'); } - if ($this->surface) { $label.="
".$langs->trans("Surface").': '.$this->surface.' '.measuring_units_string($this->surface_units, 'surface'); + if ($this->width) { + $label.="
".$langs->trans("Width").': '.$this->width.' '.measuring_units_string($this->width_units,'size'); } - if ($this->volume) { $label.="
".$langs->trans("Volume").': '.$this->volume.' '.measuring_units_string($this->volume_units, 'volume'); + if ($this->height) { + $label.="
".$langs->trans("Height").': '.$this->height.' '.measuring_units_string($this->height_units,'size'); + } + if ($this->surface) { + $label.="
".$langs->trans("Surface").': '.$this->surface.' '.measuring_units_string($this->surface_units,'surface'); + } + if ($this->volume) { + $label.="
".$langs->trans("Volume").': '.$this->volume.' '.measuring_units_string($this->volume_units,'volume'); } } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 5047ba16100..ca3691edd83 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -266,6 +266,7 @@ $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p $sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; $sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy,'; $sql.= ' p.datec as date_creation, p.tms as date_update, p.pmp,'; +$sql.= ' p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.width, p.width_units, p.height, p.height_units,'; $sql.= ' MIN(pfp.unitprice) as minsellprice'; if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && ! $show_childproducts )) { $sql .= ', pac.rowid prod_comb_id'; @@ -326,7 +327,8 @@ $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // No $sql.=$hookmanager->resPrint; $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,"; $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; -$sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.pmp'; +$sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.pmp,'; +$sql.= ' p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.width, p.width_units, p.height, p.height_units'; if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && ! $show_childproducts )) { $sql .= ', pac.rowid'; @@ -710,6 +712,18 @@ if ($resql) $product_static->accountancy_code_sell_export = $obj->accountancy_code_sell_export; $product_static->accountancy_code_sell_intra = $obj->accountancy_code_sell_intra; $product_static->accountancy_code_buy = $obj->accountancy_code_buy; + $product_static->length = $obj->length; + $product_static->length_units = $obj->length_units; + $product_static->width = $obj->width; + $product_static->width_units = $obj->width_units; + $product_static->height = $obj->height; + $product_static->height_units = $obj->height_units; + $product_static->weight = $obj->weight; + $product_static->weight_units = $obj->weight_units; + $product_static->volume = $obj->volume; + $product_static->volume_units = $obj->volume_units; + $product_static->surface = $obj->surface; + $product_static->surface_units = $obj->surface_units; if ((! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || ! empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock {