add entity in the unique key for delete

This commit is contained in:
Christophe Battarel 2012-10-17 14:25:43 +02:00
parent e8b92cc2c5
commit 8f08d7a166

View File

@ -212,7 +212,7 @@ class ProductFournisseur extends Product
{
// Delete price for this quantity
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql.= " WHERE fk_soc = ".$fourn->id." AND ref_fourn = '".$this->db->escape($ref_fourn)."' AND quantity = ".$qty;
$sql.= " WHERE fk_soc = ".$fourn->id." AND ref_fourn = '".$this->db->escape($ref_fourn)."' AND quantity = ".$qty." AND entity = ".$conf->entity;
dol_syslog(get_class($this).'::update_buyprice sql='.$sql);
$resql=$this->db->query($sql);
if ($resql)