diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 348207d32f2..5ca510ed1c5 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -1926,6 +1926,8 @@ class Commande $file = $conf->commande->dir_output . "/" . $comref . "/" . $comref . ".pdf"; if (file_exists($file)) { + commande_delete_preview($this->db, $this->id); + if (!dol_delete_file($file)) { $this->error=$langs->trans("ErrorCanNotDeleteFile",$file);