diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index f921db3b26f..766179fe3a9 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -184,7 +184,7 @@ class Commande { if (!dol_delete_file($file)) { - $this->error=$langs->trans("ErrorCanNotDeleteFile",$dir); + $this->error=$langs->trans("ErrorCanNotDeleteFile",$file); return 0; } } diff --git a/htdocs/expedition/expedition.class.php b/htdocs/expedition/expedition.class.php index 753de105829..e6c5048dcce 100644 --- a/htdocs/expedition/expedition.class.php +++ b/htdocs/expedition/expedition.class.php @@ -290,6 +290,7 @@ class Expedition $this->db->begin(); $error = 0; + $provref = $this->ref; if ($user->rights->expedition->valider) { @@ -350,18 +351,18 @@ class Expedition } // On efface le répertoire de pdf provisoire - $expeditionref = sanitize_string($this->ref); + $expeditionref = sanitize_string($provref); $expeditionref = str_replace("(","",$expeditionref); $expeditionref = str_replace(")","",$expeditionref); if ($conf->expedition->dir_output) { - $dir = $conf->expedition->dir_output . "/" . $expeditionref ; - $file = $conf->expedition->dir_output . "/" . $expeditionref . "/" . $expeditionref . ".pdf"; + $dir = $conf->expedition->dir_output . "/" . $expeditionref; + $file = $dir . "/" . $expeditionref . ".pdf"; if (file_exists($file)) { if (!dol_delete_file($file)) { - $this->error=$langs->trans("ErrorCanNotDeleteFile",$dir); + $this->error=$langs->trans("ErrorCanNotDeleteFile",$file); return 0; } } diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php index ad2278704cd..13d4cceff4b 100644 --- a/htdocs/livraison/livraison.class.php +++ b/htdocs/livraison/livraison.class.php @@ -346,12 +346,12 @@ class Livraison if ($conf->expedition->dir_output) { $dir = $conf->livraison->dir_output . "/" . $livraisonref ; - $file = $conf->livraison->dir_output . "/" . $livraisonref . "/" . $livraisonref . ".pdf"; + $file = $dir . "/" . $livraisonref . ".pdf"; if (file_exists($file)) { if (!dol_delete_file($file)) { - $this->error=$langs->trans("ErrorCanNotDeleteFile",$dir); + $this->error=$langs->trans("ErrorCanNotDeleteFile",$file); return 0; } }