New: Ajout lien suivant-prcdent sur pages des rapports mensuels.
This commit is contained in:
parent
6d0bbf1994
commit
fe56409a09
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2005 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
|
||||
@ -19,11 +19,26 @@
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/bank/annuel.php
|
||||
\ingroup banque
|
||||
\brief Page reporting mensuel Entrées/Sorties d'un compte bancaire
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
$year_start=isset($_GET["year_start"])?$_GET["year_start"]:$_POST["year_start"];
|
||||
$year_current = strftime("%Y",time());
|
||||
if (! $year_start) {
|
||||
$year_start = $year_current - 2;
|
||||
$year_end = $year_current;
|
||||
}
|
||||
else {
|
||||
$year_end=$year_start+2;
|
||||
}
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
@ -38,8 +53,9 @@ if ($user->societe_id > 0)
|
||||
{
|
||||
$socidp = $user->societe_id;
|
||||
}
|
||||
|
||||
print_titre("Rapport mensuel Entrées/Sorties, compte : <a href=\"account.php?account=".$acct->id."\">".$acct->label."</a>");
|
||||
$title=$langs->trans("IOMonthlyReporting").", ".$langs->trans("BankAccount")." : <a href=\"account.php?account=".$acct->id."\">".$acct->label."</a>";
|
||||
$lien=($year_start?"<a href='annuel.php?account=".$acct->id."&year_start=".($year_start-1)."'>".img_previous()."</a> <a href='annuel.php?account=".$acct->id."&year_start=".($year_start+1)."'>".img_next()."</a>":"");
|
||||
print_fiche_titre($title,$lien);
|
||||
print '<br>';
|
||||
|
||||
# Ce rapport de trésorerie est basé sur llx_bank (car doit inclure les transactions sans facture)
|
||||
@ -62,7 +78,7 @@ if ($db->query($sql))
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
print "Erreur: SQL $sql";
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$sql = "SELECT sum(f.amount), date_format(f.dateo,'%Y-%m') as dm";
|
||||
@ -82,25 +98,13 @@ if ($db->query($sql))
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
print "Erreur: SQL $sql";
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="3">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td rowspan=2>'.$langs->trans("Month").'</td>';
|
||||
|
||||
$year_current = strftime("%Y",time());
|
||||
|
||||
if ($year_current < (MAIN_START_YEAR + 2))
|
||||
{
|
||||
$year_start = MAIN_START_YEAR;
|
||||
$year_end = (MAIN_START_YEAR + 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$year_start = $year_current - 2;
|
||||
$year_end = $year_current;
|
||||
}
|
||||
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
@ -110,7 +114,7 @@ print '</tr>';
|
||||
print '<tr class="liste_titre">';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="right">Débits</td><td align="right">Crédits</td>';
|
||||
print '<td align="right">'.$langs->trans("Debit").'</td><td align="right">'.$langs->trans("Credit").'</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -145,7 +149,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td><b>Total annuel</b></td>";
|
||||
print "<tr ".$bc[$var]."><td><b>".$langs->trans("Total")."</b></td>";
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="right"><b>'.price($totsorties[$annee]).'</b></td><td align="right"><b>'.price($totentrees[$annee]).'</b></td>';
|
||||
|
||||
@ -58,7 +58,7 @@ function llxHeader($head = "")
|
||||
$objp = $db->fetch_object($result);
|
||||
$menu->add(DOL_URL_ROOT."/compta/bank/account.php?account=" . $objp->rowid, $objp->label);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/releve.php?account=" . $objp->rowid ,$langs->trans("AccountStatements"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=" . $objp->rowid ,"Rapport mensuel E/S");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=" . $objp->rowid ,$langs->trans("IOMonthlyReporting"));
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,9 @@ if (! isset($_GET["num"]))
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$sql = "SELECT distinct(b.num_releve) as numr";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b WHERE fk_account = ".$_GET["account"]." ORDER BY numr DESC";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql .= " WHERE fk_account = ".$_GET["account"];
|
||||
$sql .= " ORDER BY numr DESC";
|
||||
$sql .= $db->plimit($limit,$offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -81,7 +83,7 @@ if (! isset($_GET["num"]))
|
||||
$numrows = $db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
print_barre_liste("Relevés bancaires, compte : <a href=\"account.php?account=".$acct->id."\">".$acct->label."</a>", $page, "releve.php","&account=".$_GET["account"],$sortfield,$sortorder,'',$numrows);
|
||||
print_barre_liste($langs->trans("AccountStatements").", ".$langs->trans("BankAccount")." : <a href=\"account.php?account=".$acct->id."\">".$acct->label."</a>", $page, "releve.php","&account=".$_GET["account"],$sortfield,$sortorder,'',$numrows);
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user