From 0a1f0662f778289cfb74030f744dc35001c132e8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 2 Jun 2006 17:40:03 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20on=20pouvait=20entrer=20plusieurs=20fois?= =?UTF-8?q?=20un=20produit=20chez=20un=20fournisseur=20avec=20des=20ref=20?= =?UTF-8?q?=20diff=E9rentes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/langs/en_US/suppliers.lang | 3 ++- htdocs/langs/fr_FR/suppliers.lang | 3 ++- htdocs/product.class.php | 2 +- htdocs/product/fournisseurs.php | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index 7aecbdddbd2..f9df7d76b23 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -13,4 +13,5 @@ OrderDate=Order date BuyingPrice=Buying price AddSupplierPrice=Add supplier price ChangeSupplierPrice=Change supplier price -ErrorQtyTooLowForThisSupplier=Quantity too low for this supplier \ No newline at end of file +ErrorQtyTooLowForThisSupplier=Quantity too low for this supplier +ProductHasAlreadyReferenceInThisSupplier=This product has already a reference in this supplier \ No newline at end of file diff --git a/htdocs/langs/fr_FR/suppliers.lang b/htdocs/langs/fr_FR/suppliers.lang index 3c7eb0a0a61..3234d96c402 100644 --- a/htdocs/langs/fr_FR/suppliers.lang +++ b/htdocs/langs/fr_FR/suppliers.lang @@ -13,4 +13,5 @@ OrderDate=Date commande BuyingPrice=Prix d'achat AddSupplierPrice=Ajouter prix fournisseur ChangeSupplierPrice=Modifier prix fournisseur -ErrorQtyTooLowForThisSupplier=Quantité insuffisante pour ce fournisseur \ No newline at end of file +ErrorQtyTooLowForThisSupplier=Quantité insuffisante pour ce fournisseur +ProductHasAlreadyReferenceInThisSupplier=Ce produit a déjà une référence chez ce fournisseur \ No newline at end of file diff --git a/htdocs/product.class.php b/htdocs/product.class.php index a3cc1095932..37de0243aba 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -1354,7 +1354,7 @@ class Product $sql = "SELECT count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur"; $sql.= " WHERE fk_product = ".$this->id." AND fk_soc = ".$id_fourn; - $sql.= " AND ref_fourn = '".$ref_fourn."'"; + //$sql.= " AND ref_fourn = '".$ref_fourn."'"; // crée des doublons $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 4756c2d61dc..c5eae6a71b3 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -110,6 +110,10 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc if ($ret < 0) { $error++; $mesg='
'.$product->error.'
'; + if ($ret == -2) + { + $mesg='
'.$langs->trans("ProductHasAlreadyReferenceInThisSupplier").'
'; + } } }