From fe56409a090c46eaf881ae532932dd00148deffe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jan 2005 16:50:32 +0000 Subject: [PATCH] =?UTF-8?q?New:=20Ajout=20lien=20suivant-pr=E9c=E9dent=20s?= =?UTF-8?q?ur=20pages=20des=20rapports=20mensuels.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/bank/annuel.php | 50 ++++++++++++++++++---------------- htdocs/compta/bank/pre.inc.php | 2 +- htdocs/compta/bank/releve.php | 6 ++-- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 4b40dd09c88..618f5709317 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2005 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 @@ -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 : id."\">".$acct->label.""); +$title=$langs->trans("IOMonthlyReporting").", ".$langs->trans("BankAccount")." : id."\">".$acct->label.""; +$lien=($year_start?"".img_previous()." ".img_next()."":""); +print_fiche_titre($title,$lien); print '
'; # 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 ''; +print '
'; print ''; -$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 ''; print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''; + print ''; } print ''; @@ -145,7 +149,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++) } $var=!$var; -print ""; +print ""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { print ''; diff --git a/htdocs/compta/bank/pre.inc.php b/htdocs/compta/bank/pre.inc.php index 7d6706283a5..f32417794f2 100644 --- a/htdocs/compta/bank/pre.inc.php +++ b/htdocs/compta/bank/pre.inc.php @@ -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++; } } diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 598bf13eb5a..4b3b575a49f 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -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 : id."\">".$acct->label."", $page, "releve.php","&account=".$_GET["account"],$sortfield,$sortorder,'',$numrows); + print_barre_liste($langs->trans("AccountStatements").", ".$langs->trans("BankAccount")." : id."\">".$acct->label."", $page, "releve.php","&account=".$_GET["account"],$sortfield,$sortorder,'',$numrows); print '
'; print '
'.$langs->trans("Month").'
DébitsCrédits'.$langs->trans("Debit").''.$langs->trans("Credit").'
Total annuel
".$langs->trans("Total")."'.price($totsorties[$annee]).''.price($totentrees[$annee]).'
';