Fix: on pouvait entrer plusieurs fois un produit chez un fournisseur avec des ref
différentes
This commit is contained in:
parent
fda9c87c56
commit
0a1f0662f7
@ -14,3 +14,4 @@ BuyingPrice=Buying price
|
|||||||
AddSupplierPrice=Add supplier price
|
AddSupplierPrice=Add supplier price
|
||||||
ChangeSupplierPrice=Change 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
|
||||||
@ -14,3 +14,4 @@ BuyingPrice=Prix d'achat
|
|||||||
AddSupplierPrice=Ajouter prix fournisseur
|
AddSupplierPrice=Ajouter prix fournisseur
|
||||||
ChangeSupplierPrice=Modifier 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 = "SELECT count(*) as nb";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur";
|
||||||
$sql.= " WHERE fk_product = ".$this->id." AND fk_soc = ".$id_fourn;
|
$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);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -110,6 +110,10 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc
|
|||||||
if ($ret < 0) {
|
if ($ret < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$mesg='<div class="error">'.$product->error.'</div>';
|
$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