Fix: on pouvait entrer plusieurs fois un produit chez un fournisseur avec des ref
diffrentes
This commit is contained in:
parent
fda9c87c56
commit
0a1f0662f7
@ -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
|
||||
@ -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
|
||||
@ -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)
|
||||
|
||||
@ -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>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user