diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index 161ef98dd10..edf07c59e09 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -612,6 +612,7 @@ else
$sql .= ' ORDER BY dp DESC';
$result = $db->query($sql);
+
if ($result)
{
$num = $db->num_rows($result);
diff --git a/htdocs/fourn/fournisseur.facture.class.php b/htdocs/fourn/fournisseur.facture.class.php
index 15253231801..97a2335cdc0 100644
--- a/htdocs/fourn/fournisseur.facture.class.php
+++ b/htdocs/fourn/fournisseur.facture.class.php
@@ -263,7 +263,6 @@ class FactureFournisseur extends Facture
dolibarr_print_error($this->db);
return -2;
}
- $this->db->free($resql);
}
else
{
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index c6927f5ab3c..6b49f3b090b 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -811,14 +811,15 @@ class Form
\param htmlname Nom de la zone select
\param filtretype Pour filtre sur type de produit
\param limit Limite sur le nombre de lignes retournées
+ \param price_level Niveau de prix en fonction du client
*/
function select_produits($selected='',$htmlname='productid',$filtretype='',$limit=20,$price_level=0)
{
- global $langs,$conf,$user;
+ global $langs,$conf;
if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)
{
print $langs->trans("RefOrLabel").' : ';
- print ajax_updater($htmlname,'keysearch','/product/ajaxproducts.php','&price_level='.$price_level.'','ajaxworking');
+ print ajax_updater($htmlname,'keysearch','/product/ajaxproducts.php','&price_level='.$price_level.'&type=1','ajaxworking');
}
else
{
@@ -832,6 +833,8 @@ class Form
\param htmlname Nom de la zone select
\param filtretype Pour filtre sur type de produit
\param limit Limite sur le nombre de lignes retournées
+ \param price_level Niveau de prix en fonction du client
+ \param ajaxkeysearch Filtre des produits si ajax est utilisé
*/
function select_produits_do($selected='',$htmlname='productid',$filtretype='',$limit=20,$price_level=0,$ajaxkeysearch='')
{
@@ -896,8 +899,8 @@ class Form
else
{
print '