Fix: on pouvait entrer plusieurs fois un produit chez un fournisseur avec des ref

diffrentes
This commit is contained in:
Regis Houssin 2006-06-02 17:40:03 +00:00
parent fda9c87c56
commit 0a1f0662f7
4 changed files with 9 additions and 3 deletions

View File

@ -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
ErrorQtyTooLowForThisSupplier=Quantity too low for this supplier
ProductHasAlreadyReferenceInThisSupplier=This product has already a reference in this supplier

View File

@ -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
ErrorQtyTooLowForThisSupplier=Quantité insuffisante pour ce fournisseur
ProductHasAlreadyReferenceInThisSupplier=Ce produit a déjà une référence chez ce fournisseur

View File

@ -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)

View File

@ -110,6 +110,10 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc
if ($ret < 0) {
$error++;
$mesg='<div class="error">'.$product->error.'</div>';
if ($ret == -2)
{
$mesg='<div class="error">'.$langs->trans("ProductHasAlreadyReferenceInThisSupplier").'</div>';
}
}
}