* Copyright (C) 2004-2006 Laurent Destailleur * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ */ /** \file htdocs/compta/paiement/rapport.php \ingroup facture \brief Rapports de paiements \version $Revision$ */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/rapport/pdf_paiement.class.php"); $user->getrights("facture"); // Sécurité accés if (! $user->rights->facture->lire) accessforbidden(); $dir = $conf->compta->dir_output.'/payments'; $socid=0; if ($user->societe_id > 0) { $action = ''; $socid = $user->societe_id; $dir = DOL_DATA_ROOT.'/private/'.$user->id.'/compta'; } $year = $_GET["year"]; if (! $year) { $year=date("Y"); } /* * Action générer fichier rapport paiements */ if ($_POST["action"] == 'gen') { $rap = new pdf_paiement($db); $rap->write_pdf_file($dir, $_POST["remonth"], $_POST["reyear"]); $year = $_POST["reyear"]; } llxHeader(); /* * Affichage liste des paiements * */ $titre=($year?$langs->trans("PaymentsReportsForYear",$year):$langs->trans("PaymentsReports")); print_titre($titre); // Formulaire de génération print '
'; print ''; $cmonth = date("n", time()); $syear = date("Y", time()); print '"; print '\n"; print ''; print '
'; print '
'; clearstatcache(); // Affiche lien sur autres années $found=0; if (is_dir($dir)) { $handle=opendir($dir); while (($file = readdir($handle))!==false) { if (is_dir($dir.'/'.$file) && ! eregi('^\.',$file)) { $found=1; print ''.$file.' '; } } } if ($year) { if (is_dir($dir.'/'.$year)) { $handle=opendir($dir.'/'.$year); if ($found) print '
'; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; $var=true; while (($file = readdir($handle))!==false) { if (eregi('^payment',$file)) { $var=!$var; $tfile = $dir . '/'.$year.'/'.$file; $relativepath = $year.'/'.$file; print "".''; print ''; print ''; } } print '
'.$langs->trans("Reporting").''.$langs->trans("Size").''.$langs->trans("Date").'
'.img_pdf().' '.$file.''.filesize($tfile). ' '.$langs->trans("Bytes").''.dolibarr_print_date(filemtime($tfile),"%d %b %Y %H:%M:%S").'
'; } } $db->close(); llxFooter('$Date$ - $Revision$'); ?>