1389 |
|
|
1390 |
/* |
/* |
1391 |
* Documents générés |
* Documents générés |
|
* Le fichier de facture détaillée est de la forme |
|
|
* REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse |
|
1392 |
*/ |
*/ |
1393 |
|
$filename=sanitize_string($fac->ref); |
1394 |
$facref = sanitize_string($fac->ref); |
$filedir=$conf->facture->dir_output . "/" . sanitize_string($fac->ref); |
1395 |
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf"; |
$urlsource=$_SERVER["PHP_SELF"]."?facid=".$fac->id; |
1396 |
$relativepath = "${facref}/${facref}.pdf"; |
// $genallowed=($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer); |
1397 |
|
// $delallowed=$user->rights->facture->supprimer; |
1398 |
|
$genallowed=0; |
1399 |
|
$delallowed=0; |
1400 |
|
|
1401 |
$var=true; |
$var=true; |
1402 |
|
|
1403 |
if (file_exists($file)) |
print "<br>\n"; |
1404 |
{ |
$html->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed); |
|
print "<br>\n"; |
|
|
print_titre("Documents"); |
|
|
print '<table class="border" width="100%">'; |
|
|
|
|
|
print "<tr $bc[$var]><td>".$langs->trans("Bill")." PDF</td>"; |
|
|
|
|
|
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepath).'">'.$fac->ref.'.pdf</a></td>'; |
|
|
print '<td align="right">'.filesize($file). ' bytes</td>'; |
|
|
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>'; |
|
|
print '</tr>'; |
|
|
|
|
|
|
|
|
$dir = $conf->facture->dir_output . "/" . $facref . "/"; |
|
|
$handle=opendir($dir); |
|
|
|
|
|
while (($file = readdir($handle))!==false) |
|
|
{ |
|
|
if (is_readable($dir.$file) && substr($file, -10) == 'detail.pdf') |
|
|
{ |
|
|
print "<tr $bc[$var]><td>Facture détaillée</td>"; |
|
|
$relativepathdetail = "${facref}/$file"; |
|
|
|
|
|
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepathdetail).'">'.$file.'</a></td>'; |
|
|
print '<td align="right">'.filesize($dir.$file). ' bytes</td>'; |
|
|
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($dir.$file)).'</td>'; |
|
|
print '</tr>'; |
|
|
} |
|
|
} |
|
|
print "</table>\n"; |
|
|
} |
|
1405 |
|
|
1406 |
|
|
1407 |
/* |
/* |