From 79edf0fb152e183b78e4076bd028bbbf0131694e Mon Sep 17 00:00:00 2001 From: UltraViolet33 <93035200+UltraViolet33@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:18:27 +0200 Subject: [PATCH] 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 --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index a25e8dec9a1..705eb5ba5be 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -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();