Fix: [ bug #233 ] Delete invoice problem with a discount

This commit is contained in:
Laurent Destailleur 2011-11-19 19:04:55 +01:00
parent a4570c578e
commit e08e07c493

View File

@ -1205,8 +1205,8 @@ class Facture extends CommonObject
if (sizeof($list_rowid_det)) if (sizeof($list_rowid_det))
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except';
$sql.= ' SET fk_facture = NULL'; $sql.= ' SET fk_facture = NULL, fk_facture_line = NULL';
$sql.= ' WHERE fk_facture IN ('.join(',',$list_rowid_det).')'; $sql.= ' WHERE fk_facture_line IN ('.join(',',$list_rowid_det).')';
dol_syslog("Facture.class::delete sql=".$sql); dol_syslog("Facture.class::delete sql=".$sql);
if (! $this->db->query($sql)) if (! $this->db->query($sql))