diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 3a63ab8e643..e23edd0e78f 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (c) 2004-2006 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -21,10 +21,10 @@ */ /** - \file htdocs/compta/facture/stats/index.php - \ingroup facture - \brief Page des stats factures - \version $Revision$ + \file htdocs/compta/facture/stats/index.php + \ingroup facture + \brief Page des stats factures + \version $Revision$ */ require("./pre.inc.php"); @@ -51,62 +51,60 @@ $data = $stats->getNbByMonthWithPrevYear($year); create_exdir($conf->facture->dir_temp); $filename = $conf->facture->dir_temp."/nbfacture2year-".$year.".png"; -$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=nbfacture2year-'.$year.'.png'; +$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=nbfacture2year-'.$year.'.png'; $px = new DolGraph(); $mesg = $px->isGraphKo(); if (! $mesg) { $px->SetData($data); - $px->SetPrecisionY(0); + $px->SetPrecisionY(0); $px->SetMaxValue($px->GetCeilMaxValue()); $px->SetLegend(array($year - 1, $year)); $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); $px->SetShading(5); - $px->SetHorizTickIncrement(1); - $px->SetPrecisionY(0); + $px->SetHorizTickIncrement(1); + $px->SetPrecisionY(0); $px->draw($filename); } $sql = "SELECT count(*) as nb, date_format(datef,'%Y') as dm, sum(total) as total FROM ".MAIN_DB_PREFIX."facture WHERE fk_statut > 0 "; if ($socid) { - $sql .= " AND fk_soc = $socid"; + $sql .= " AND fk_soc=$socid"; } -$sql .= " GROUP BY dm DESC "; +$sql.= " GROUP BY dm DESC;"; $resql=$db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - - print ''; - print ''; - print ''; - $i = 0; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $nbproduct = $obj->nb; - $year = $obj->dm; - $total = price($obj->total); - print ""; - print ''; - $i++; - } - - print '
'.$langs->trans("Year").''.$langs->trans("NumberOfBills").''.$langs->trans("AmountTotal").''; - if ($mesg) { print $mesg; } - else { print 'Nombre de factures par mois'; } - print '
'.$year.''.$nbproduct.''.$total.'
'; - $db->free(); + $num = $db->num_rows($resql); + + print ''; + print ''; + print ''; + + while ($obj = $db->fetch_object($resql)) + { + $nbproduct = $obj->nb; + $year = $obj->dm; + $total = price($obj->total); + print ""; + print ''; + + } + + print '
'.$langs->trans("Year").''.$langs->trans("NumberOfBills").''.$langs->trans("AmountTotal").''; + if ($mesg) { print $mesg; } + else { print 'Nombre de factures par mois'; } + print '
'.$year.''.$nbproduct.''.$total.'
'; + $db->free($resql); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } - $db->close(); llxFooter('$Date$ - $Revision$'); diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index e5b7b93753c..5c068728616 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (C) 2004-2006 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -20,10 +20,11 @@ * $Source$ */ -/** \file htdocs/compta/paiement/rapport.php - \ingroup facture - \brief Rapports de paiements - \version $Revision$ +/** + \file htdocs/compta/paiement/rapport.php + \ingroup facture + \brief Rapports de paiements + \version $Revision$ */ require("./pre.inc.php"); @@ -31,7 +32,6 @@ 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(); @@ -41,19 +41,14 @@ $dir = $conf->compta->dir_output; $socid=0; if ($user->societe_id > 0) { - $action = ''; - $socid = $user->societe_id; - $dir = DOL_DATA_ROOT.'/private/'.$user->id.'/compta'; + $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 */ @@ -65,8 +60,6 @@ if ($_POST["action"] == 'gen') $year = $_POST["reyear"]; } - - llxHeader(); /* @@ -82,21 +75,19 @@ print ''; $cmonth = date("n", time()); $syear = date("Y", time()); - print '"; - print '\n"; print ''; print ''; - print '
'; clearstatcache(); @@ -123,49 +113,48 @@ clearstatcache(); $found=0; if (is_dir($dir)) { - $handle=opendir($dir); - while (($file = readdir($handle))!==false) + $handle=opendir($dir); + while (($file = readdir($handle))!==false) { - if (is_dir($dir.'/'.$file) && ! eregi('^\.',$file)) - { - $found=1; - print ''.$file.' '; - } + if (is_dir($dir.'/'.$file) && ! eregi('^\.',$file)) + { + $found=1; + print ''.$file.' '; + } } } if ($year) { - if (is_dir($dir.'/'.$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) { - $handle=opendir($dir.'/'.$year); - - if ($found) print '
'; - print '
'; - - print '
'.$langs->trans("Reporting").''.$langs->trans("Size").''.$langs->trans("Date").'
'; - 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").'
'; + if (eregi('^payment',$file)) + { + $var=!$var; + $tfile = $dir . '/'.$year.'/'.$file; + $relativepath = $year.'/'.$file; + print "".''.img_pdf().' '.$file.''; + print ''.filesize($tfile). ' '.$langs->trans("Bytes").''; + print ''.dolibarr_print_date(filemtime($tfile),"%d %b %Y %H:%M:%S").''; + } } + print ''; + } } $db->close(); - + llxFooter('$Date$ - $Revision$'); ?>