diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 48dc7a3ebf2..3faedf4b601 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -6,6 +6,7 @@
* Copyright (C) 2013 Cédric Salvador
* Copyright (C) 2014 Marcos García
* Copyright (C) 2015 Bahfir Abbes
+ * Copyright (C) 2016 Ferran Marcet
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -716,9 +717,6 @@ class FormFile
if ($modulepart == 'export') {
$relativepath = $file["name"];
}
- if ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_fournisseur') {
- $relativepath = get_exdir($modulesubdir, 2,0,0,null,'invoice_supplier'). $modulesubdir. "/" . $file["name"];
- }
// Show file name with link to download
$out.= 'getNomUrl(1);
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref);
- print $formfile->getDocumentsLink('facture_fournisseur', $filename, $filedir);
+ $subdir = get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref);
+ print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir);
print "\n";
// Ref supplier