diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index c4e14364165..ae2f4c5cfcb 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -22,7 +22,7 @@ * \file htdocs/fourn/class/fournisseur.product.class.php * \ingroup produit * \brief File of class to manage predefined suppliers products - * \version $Id: fournisseur.product.class.php,v 1.10 2011/08/20 23:56:03 eldy Exp $ + * \version $Id: fournisseur.product.class.php,v 1.11 2011/08/21 00:27:31 eldy Exp $ */ require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; @@ -540,6 +540,16 @@ class ProductFournisseur extends Product { global $conf; + $this->product_fourn_price_id = ''; + $this->product_fourn_id = ''; + $this->fourn_ref = ''; + $this->fourn_price = ''; + $this->fourn_qty = ''; + $this->fourn_unitprice = ''; + $this->fourn_id = ''; + $this->fourn_name = ''; + $this->id = ''; + $sql = "SELECT s.nom as supplier_name, "; $sql.= " s.rowid as fourn_id,"; $sql.= " pf.ref_fourn,"; @@ -547,12 +557,13 @@ class ProductFournisseur extends Product $sql.= " pf.rowid as product_fourn_id, "; $sql.= " pfp.price, pfp.quantity, pfp.unitprice"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."product_fournisseur as pf ON pf.fk_soc = s.rowid "; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."product_fournisseur as pf ON pf.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " ON pf.rowid = pfp.fk_product_fournisseur"; $sql.= " WHERE s.entity = ".$conf->entity; $sql.= " AND pf.fk_product = ".$prodid; $sql.= " ORDER BY pfp.unitprice"; + $sql.= $this->db->plimit(1); dol_syslog(get_class($this)."::find_min_price_product_fournisseur sql=".$sql, LOG_DEBUG); @@ -598,7 +609,7 @@ class ProductFournisseur extends Product { global $langs; $langs->load("suppliers"); - $out=price($this->fourn_unitprice).' ('.$langs->trans("Supplier").': '.$this->getSocNomUrl(1).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.')'; + $out=price($this->fourn_unitprice).' '.$langs->trans("HT").' ('.$langs->trans("Supplier").': '.$this->getSocNomUrl(1).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.')'; return $out; } diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index 6497d599273..2121d80dbea 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -13,6 +13,7 @@ ShowSupplier=Show supplier OrderDate=Order date BuyingPrice=Buying price BuyingPriceMin=Minimum buying price +BuyingPriceMinShort=Min buying price AddSupplierPrice=Add supplier price ChangeSupplierPrice=Change supplier price ErrorQtyTooLowForThisSupplier=Quantity too low for this supplier or no price defined on this product for this supplier diff --git a/htdocs/langs/fr_FR/suppliers.lang b/htdocs/langs/fr_FR/suppliers.lang index 765a9623688..c042b74ea89 100644 --- a/htdocs/langs/fr_FR/suppliers.lang +++ b/htdocs/langs/fr_FR/suppliers.lang @@ -13,6 +13,7 @@ ShowSupplier=Afficher fournisseur OrderDate=Date commande BuyingPrice=Prix d'achat BuyingPriceMin=Prix d'achat minimum +BuyingPriceMinShort=Prix achat min AddSupplierPrice=Ajouter prix fournisseur ChangeSupplierPrice=Modifier prix fournisseur ErrorSupplierCountryIsNotDefined=Le pays de ce fournisseur n'est pas défini. Corriger sur sa fiche. diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 2067a4b55b9..ccb41e07654 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -23,7 +23,7 @@ * \file htdocs/product/fournisseurs.php * \ingroup product * \brief Page of tab suppliers for products - * \version $Id: fournisseurs.php,v 1.100 2011/08/20 23:56:04 eldy Exp $ + * \version $Id: fournisseurs.php,v 1.101 2011/08/21 00:26:31 eldy Exp $ */ require("../main.inc.php"); @@ -237,7 +237,7 @@ if ($_GET["id"] || $_GET["ref"]) $product_fourn = new ProductFournisseur($db); if ($product_fourn->find_min_price_product_fournisseur($product->id) > 0) { - if (isset($product_fourn->fourn_unitprice)) print $product_fourn->display_price_product_fournisseur(); + if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(); else print $langs->trans("NotDefined"); } print ''; @@ -449,5 +449,5 @@ else $db->close(); -llxFooter('$Date: 2011/08/20 23:56:04 $ - $Revision: 1.100 $'); +llxFooter('$Date: 2011/08/21 00:26:31 $ - $Revision: 1.101 $'); ?> \ No newline at end of file diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 5f53bc97a53..dfc92882596 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -21,11 +21,12 @@ * \file htdocs/product/liste.php * \ingroup produit * \brief Page to list products and services - * \version $Id: liste.php,v 1.153 2011/08/20 23:56:04 eldy Exp $ + * \version $Id: liste.php,v 1.154 2011/08/21 00:26:31 eldy Exp $ */ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php'); +require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.product.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); if ($conf->categorie->enabled) require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php"); @@ -104,6 +105,7 @@ if ($conf->categorie->enabled && GETPOST('catid')) */ $htmlother=new FormOther($db); +$html=new Form($db); if (! empty($objcanvas->template_dir)) { @@ -295,8 +297,8 @@ if ($resql) print_liste_field_titre($langs->trans("DateModification"), $_SERVER["PHP_SELF"], "p.tms",$param,"",'align="center"',$sortfield,$sortorder); if ($conf->service->enabled && $type != 0) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder); if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("SellingPrice"), $_SERVER["PHP_SELF"], "p.price",$param,"",'align="right"',$sortfield,$sortorder); + print '