Skip to content
Snippets Groups Projects
Commit 563b1578 authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

Modifie l'affichage des facture detaillée

parent e9db2af3
No related branches found
No related tags found
No related merge requests found
...@@ -1176,10 +1176,10 @@ else ...@@ -1176,10 +1176,10 @@ else
* Documents générés * Documents générés
* *
*/ */
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref); $facref = str_replace($forbidden_chars,"_",$fac->ref);
$file = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf"; $file = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf";
$filedetail = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . "-detail.pdf";
print "<table width=\"100%\" cellspacing=2><tr><td width=\"50%\" valign=\"top\">"; print "<table width=\"100%\" cellspacing=2><tr><td width=\"50%\" valign=\"top\">";
...@@ -1197,17 +1197,23 @@ else ...@@ -1197,17 +1197,23 @@ else
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>'; print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
print '</tr>'; print '</tr>';
if (file_exists($filedetail)) // facture détaillée supplémentaire
$dir = FAC_OUTPUTDIR . "/" . $facref . "/";
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
{ {
$encfile = urlencode($filedetail); if (is_readable($dir.$file) && substr($file, -10) == 'detail.pdf')
{
$encfile = urlencode($dir.$file);
print "<tr $bc[0]><td>Facture détaillée</td>"; print "<tr $bc[0]><td>Facture détaillée</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?file='.$encfile.'">'.$fac->ref.'-detail.pdf</a></td>'; print '<td><a href="'.DOL_URL_ROOT . '/document.php?file='.$encfile.'">'.$fac->ref.'-detail.pdf</a></td>';
print '<td align="right">'.filesize($filedetail). ' bytes</td>'; print '<td align="right">'.filesize($dir.$file). ' bytes</td>';
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($filedetail)).'</td>'; print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($dir.$file)).'</td>';
print '</tr>'; print '</tr>';
} }
}
print "</table>\n"; print "</table>\n";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment