Modifie l'affichage des facture detaillée

This commit is contained in:
Rodolphe Quiedeville 2004-11-09 08:58:35 +00:00
parent e9db2af363
commit 563b157844

View File

@ -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
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";
} }