Ajout scurit pour n'effacer que les commandes en mode brouillons

This commit is contained in:
Rodolphe Quiedeville 2006-12-18 14:01:18 +00:00
parent 37291131ef
commit e1357f346b

View File

@ -889,7 +889,15 @@ class CommandeFournisseur extends Commande
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE rowid =".$this->id;
if (! $this->db->query($sql) )
$sql.= " AND fk_statut = 0;";
if ($resql = $this->db->query($sql) )
{
if ($this->db->affected_rows($resql) <> 1)
{
$err++;
}
}
else
{
$err++;
}