diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index cbdecd2e85e..89513ad24b2 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -415,7 +415,7 @@ if ($result) { $thirdpartystatic = new Societe($db); $facturefourn_static = new FactureFournisseur($db); - $product_static = new Product($db); + $product_static = new ProductFournisseur($db); $isBuyerInEEC = isInEEC($mysoc); diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 927e7e33b09..0f9ee04c63e 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1075,11 +1075,83 @@ class ProductFournisseur extends Product $result = ''; - $label = ''.$langs->trans("SupplierRef").''; - $label .= '
'; - $label .= ''.$langs->trans('Product').': '.$this->product_ref; + if (!empty($this->entity)) { + $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80); + if ($this->nbphoto > 0) { + $label .= '
'; + $label .= $tmpphoto; + $label .= '
'; + } + } + + if ($this->type == Product::TYPE_PRODUCT) { + $label .= img_picto('', 'product').' '.$langs->trans("Product").''; + } elseif ($this->type == Product::TYPE_SERVICE) { + $label .= img_picto('', 'service').' '.$langs->trans("Service").''; + } + if (isset($this->status) && isset($this->status_buy)) { + $label .= ' '.$this->getLibStatut(5, 0); + $label .= ' '.$this->getLibStatut(5, 1); + } + + if (!empty($this->ref)) { + $label .= '
'.$langs->trans('ProductRef').': '.($this->ref ? $this->ref : $this->product_ref); + } + if (!empty($this->label)) { + $label .= '
'.$langs->trans('ProductLabel').': '.$this->label; + } $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier; + if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { + if (!empty($conf->productbatch->enabled)) { + $langs->load("productbatch"); + $label .= "
".$langs->trans("ManageLotSerial").': '.$this->getLibStatut(0, 2); + } + } + if (!empty($conf->barcode->enabled)) { + $label .= '
'.$langs->trans('BarCode').': '.$this->barcode; + } + + if ($this->type == Product::TYPE_PRODUCT) + { + if ($this->weight) { + $label .= "
".$langs->trans("Weight").': '.$this->weight.' '.measuringUnitString(0, "weight", $this->weight_units); + } + $labelsize = ""; + if ($this->length) { + $labelsize .= ($labelsize ? " - " : "")."".$langs->trans("Length").': '.$this->length.' '.measuringUnitString(0, 'size', $this->length_units); + } + if ($this->width) { + $labelsize .= ($labelsize ? " - " : "")."".$langs->trans("Width").': '.$this->width.' '.measuringUnitString(0, 'size', $this->width_units); + } + if ($this->height) { + $labelsize .= ($labelsize ? " - " : "")."".$langs->trans("Height").': '.$this->height.' '.measuringUnitString(0, 'size', $this->height_units); + } + if ($labelsize) $label .= "
".$labelsize; + + $labelsurfacevolume = ""; + if ($this->surface) { + $labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."".$langs->trans("Surface").': '.$this->surface.' '.measuringUnitString(0, 'surface', $this->surface_units); + } + if ($this->volume) { + $labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."".$langs->trans("Volume").': '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units); + } + if ($labelsurfacevolume) $label .= "
".$labelsurfacevolume; + } + + if (!empty($conf->accounting->enabled) && $this->status) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; + $label .= '
'.$langs->trans('ProductAccountancySellCode').': '.length_accountg($this->accountancy_code_sell); + $label .= '
'.$langs->trans('ProductAccountancySellIntraCode').': '.length_accountg($this->accountancy_code_sell_intra); + $label .= '
'.$langs->trans('ProductAccountancySellExportCode').': '.length_accountg($this->accountancy_code_sell_export); + } + if (!empty($conf->accounting->enabled) && $this->status_buy) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; + $label .= '
'.$langs->trans('ProductAccountancyBuyCode').': '.length_accountg($this->accountancy_code_buy); + $label .= '
'.$langs->trans('ProductAccountancyBuyIntraCode').': '.length_accountg($this->accountancy_code_buy_intra); + $label .= '
'.$langs->trans('ProductAccountancyBuyExportCode').': '.length_accountg($this->accountancy_code_buy_export); + } + $logPrices = $this->listProductFournisseurPriceLog($this->product_fourn_price_id, 'pfpl.datec', 'DESC'); // set sort order here if (is_array($logPrices) && count($logPrices) > 0) { $label .= '

';