Fix delete commande fournisseur line linked to commandedet (#31136)

When a commande fournisseur line is deleted, the wrong commandedet.fk_commandefourndet was set to NULL
and the commande fournisseur line deletion was impossible if it was link to a commandet.

Co-authored-by: Ulysse Valdenaire <uvaldenaire@easya.solutions>
This commit is contained in:
UltraViolet33 2024-09-26 17:18:27 +02:00 committed by GitHub
parent e125ab4783
commit 79edf0fb15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4135,7 +4135,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
return -1;
}
$sql1 = 'UPDATE '.MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE rowid=".((int) $this->id);
$sql1 = 'UPDATE '.MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet=".((int) $this->id);
$resql = $this->db->query($sql1);
if (!$resql) {
$this->db->rollback();