Quelques amliorations sur le journal de caisse:

Le libell menu "caisse" renomm en "Journal de caisse"
Le libell menu "annuel" renomm en "Rsum annuel".
Les liens mois dans le rsum annuel ouvre directement le livre journal du mois cliqu.
This commit is contained in:
Laurent Destailleur
2004-03-04 19:24:30 +00:00
parent 188e3676d4
commit 02dcbeaaf4
2 changed files with 49 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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<EFBFBD>sum<EFBFBD> annuel des journaux comptables");
print '<br>';
$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 '<table class="border" width="100%" border="1" cellspacing="0" cellpadding="4">';
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
print '<tr class="liste_titre"><td rowspan=2>Mois</td>';
$year_current = strftime("%Y",time());
if ($year_current < (MAIN_START_YEAR + 2))
{
@@ -103,14 +109,16 @@ print '</tr>';
print '<tr class="liste_titre">';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print '<td align="center">D<>bits</td><td align="center">Cr<43>dits</td>';
print '<td align="right">D<>penses</td><td align="right">Recettes</td>';
}
print '</tr>';
$var=True;
for ($mois = 1 ; $mois < 13 ; $mois++)
{
print '<tr>';
print "<td>".strftime("%B",mktime(1,1,1,$mois,1,2000))."</td>";
$var=!$var;
print '<tr '.$bc[$var].'>';
print "<td><a href=\"index.php?year=$year_current&mois=$mois\">".strftime("%B",mktime(1,1,1,$mois,1,$annee))."</a></td>";
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print '<td align="right" width="10%">&nbsp;';
@@ -133,7 +141,8 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
print '</tr>';
}
print "<tr><td><b>Total annuel</b></td>";
$var=!$var;
print "<tr $bc[$var]><td><b>Total annuel</b></td>";
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print '<td align="right">'.$totsorties[$annee].'</td><td align="right">'.$totentrees[$annee].'</td>';

View File

@@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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<69> acc<63>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 '<br>';
// 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 '<table class="noborder" width="100%" cellspacing="0" cellpading="3">';
print '<tr class="liste_titre"><td>Jour</td><td>Description</td><td>Montant</td><td>Type</td></tr>';
print '<tr><td colspan="4">Fonction pas encore disponible</td></tr>';
print "</table>";
// 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 '<table width="100%" border="1">';
print '<tr class="liste_titre"><td></td>';
print '<br>';
print_fiche_titre("D<EFBFBD>penses");
print '<table class="noborder" width="100%" cellspacing="0" cellpading="3">';
print '<tr class="liste_titre"><td>Jour</td><td>Description</td><td>Montant</td><td>Type</td></tr>';
print '<tr><td colspan="4">Fonction pas encore disponible</td></tr>';
print "</table>";
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");