/[dolibarr]/dolibarr/htdocs/compta/facture.php
ViewVC logotype

Diff of /dolibarr/htdocs/compta/facture.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.197 by eldy, Sat Aug 20 19:02:26 2005 UTC revision 1.198 by eldy, Tue Aug 23 19:35:28 2005 UTC
# Line 1389  else Line 1389  else
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              /*              /*

Legend:
Removed from v.1.197  
changed lines
  Added in v.1.198

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26