diff --git a/htdocs/compta/caisse/annuel.php b/htdocs/compta/caisse/annuel.php index f1d9b6bdd58..5cc58ef9587 100644 --- a/htdocs/compta/caisse/annuel.php +++ b/htdocs/compta/caisse/annuel.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 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 @@ -35,7 +36,13 @@ if ($user->societe_id > 0) $socidp = $user->societe_id; } -print_titre("Caisse"); +$year_current = $_GET["year"];; +if (! $year_current) { $year_current = strftime("%Y", time()); } + + +print_titre("Résumé annuel des journaux comptables"); +print '
'; + $sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."paiement as f"; @@ -79,10 +86,9 @@ if ($db->query($sql)) } } -print ''; +print '
'; print ''; -$year_current = strftime("%Y",time()); if ($year_current < (MAIN_START_YEAR + 2)) { @@ -103,14 +109,16 @@ print ''; print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''; + print ''; } print ''; +$var=True; for ($mois = 1 ; $mois < 13 ; $mois++) { - print ''; - print ""; + $var=!$var; + print ''; + print ""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { print ''; } -print ""; +$var=!$var; +print ""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { print ''; diff --git a/htdocs/compta/caisse/index.php b/htdocs/compta/caisse/index.php index b270a0b29a5..fcf3b046ca2 100644 --- a/htdocs/compta/caisse/index.php +++ b/htdocs/compta/caisse/index.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 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 @@ -27,6 +28,9 @@ require("./pre.inc.php"); llxHeader(); +$mois=$_GET["mois"]; +$annee=$_GET["annee"]; + /* * Sécurité accés client */ @@ -47,10 +51,14 @@ if (!$annee) $time = mktime(12,0,0,$mois, 1, $annee); -$titre_mois = strftime("%B %Y", $time); +$titre_mois = strftime("%B", $time); -print_fiche_titre("Journal de caisse"); +print_fiche_titre("Livre Journal".($mois?" $titre_mois":"").($annee?" $annee":"")); +print '
'; + + +// Recettes $sql = "SELECT f.amount, date_format(f.datep,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."paiement as f"; $sql .= " WHERE date_format(f.datep,'%Y%m') = ".$annee.$mois; @@ -71,7 +79,20 @@ if ($db->query($sql)) $i++; } } +else { + print $db->error(); +} +print_fiche_titre("Recettes"); +print '
Mois
DébitsCréditsDépensesRecettes
".strftime("%B",mktime(1,1,1,$mois,1,2000))."
".strftime("%B",mktime(1,1,1,$mois,1,$annee))." '; @@ -133,7 +141,8 @@ for ($mois = 1 ; $mois < 13 ; $mois++) print '
Total annuel
Total annuel'.$totsorties[$annee].''.$totentrees[$annee].'
'; +print ''; + +print ''; + +print "
JourDescriptionMontantType
Fonction pas encore disponible
"; + + +// Dépenses $sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%d') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as f"; @@ -92,14 +113,22 @@ if ($db->query($sql)) $i++; } } +else { + print $db->error(); +} -print ''; -print ''; +print '
'; +print_fiche_titre("Dépenses"); +print '
'; +print ''; +print ''; print "
JourDescriptionMontantType
Fonction pas encore disponible
"; + + $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$");