Erg: Les fonctions compte bancaires sont regroupées en onglets

This commit is contained in:
Laurent Destailleur 2006-08-13 00:34:16 +00:00
parent ffed30c84b
commit bf255eaf3d
21 changed files with 1054 additions and 1108 deletions

View File

@ -185,7 +185,7 @@ class CompanyBankAccount
*/ */
function verif() function verif()
{ {
require_once DOL_DOCUMENT_ROOT . '/compta/bank/bank.lib.php'; require_once DOL_DOCUMENT_ROOT . '/lib/bank.lib.php';
if (strlen(trim($this->code_banque)) == 0) if (strlen(trim($this->code_banque)) == 0)

View File

@ -271,7 +271,7 @@ class Account
if (! $this->min_desired) $this->min_desired=0; if (! $this->min_desired) $this->min_desired=0;
// Chargement librairie pour acces fonction controle RIB // Chargement librairie pour acces fonction controle RIB
require_once DOL_DOCUMENT_ROOT . '/compta/bank/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/lib/bank.lib.php';
if (! verif_rib($this->code_banque,$this->code_guichet,$this->number,$this->cle_rib,$this->iban_prefix)) { if (! verif_rib($this->code_banque,$this->code_guichet,$this->number,$this->cle_rib,$this->iban_prefix)) {
$this->error="Le contrôle de la clé indique que les informations de votre compte bancaire sont incorrectes."; $this->error="Le contrôle de la clé indique que les informations de votre compte bancaire sont incorrectes.";
@ -388,7 +388,7 @@ class Account
global $langs; global $langs;
// Chargement librairie pour acces fonction controle RIB // Chargement librairie pour acces fonction controle RIB
require_once(DOL_DOCUMENT_ROOT . '/compta/bank/bank.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/bank.lib.php');
dolibarr_syslog("Account.class::update $this->code_banque,$this->code_guichet,$this->number,$this->cle_rib,$this->iban_prefix"); dolibarr_syslog("Account.class::update $this->code_banque,$this->code_guichet,$this->number,$this->cle_rib,$this->iban_prefix");

View File

@ -30,6 +30,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
if (!$user->rights->banque->lire) if (!$user->rights->banque->lire)
accessforbidden(); accessforbidden();
@ -67,6 +68,7 @@ if ($_POST["action"] == 'add' && $account && ! isset($_POST["cancel"]))
if ($insertid) if ($insertid)
{ {
Header("Location: account.php?account=" . $account); Header("Location: account.php?account=" . $account);
exit;
} }
else else
{ {
@ -191,9 +193,13 @@ if ($account > 0)
} }
print_fiche_titre("Journal de trésorerie du compte : " .$acct->label,$mesg); $titre=$langs->trans("FinancialAccount")." : ".$acct->label;
print_fiche_titre($titre,$mesg);
// Onglets
$head=bank_prepare_head($acct);
dolibarr_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0);
print '<br>';
print '<table class="notopnoleftnoright" width="100%">'; print '<table class="notopnoleftnoright" width="100%">';
/* /*
@ -202,7 +208,7 @@ if ($account > 0)
*/ */
// Formulaire de saisie d'une opération hors factures // Formulaire de saisie d'une opération hors factures
if ($user->rights->banque->modifier && $_GET["action"]=='rappro') if ($user->rights->banque->modifier && $_GET["action"]=='addline')
{ {
$html=new Form($db); $html=new Form($db);
@ -211,6 +217,8 @@ if ($account > 0)
print '<input type="hidden" name="vline" value="' . $vline . '">'; print '<input type="hidden" name="vline" value="' . $vline . '">';
print '<input type="hidden" name="account" value="' . $acct->id . '">'; print '<input type="hidden" name="account" value="' . $acct->id . '">';
print "<tr class=\"noborder\"><td colspan=\"8\">&nbsp;</td></tr>\n";
print '<tr>'; print '<tr>';
print '<td align="left" colspan="8"><b>'.$langs->trans("AddBankRecordLong").'</b></td>'; print '<td align="left" colspan="8"><b>'.$langs->trans("AddBankRecordLong").'</b></td>';
print '</tr>'; print '</tr>';
@ -260,7 +268,7 @@ if ($account > 0)
print '<input type="hidden" name="account" value="' . $acct->id . '">'; print '<input type="hidden" name="account" value="' . $acct->id . '">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3"><a href="graph.php?id='.$acct->id.'">Graph</a></td>'; print '<td colspan="3">&nbsp;</td>';
print '<td><input type="text" class="flat" name="req_desc" value="'.$_POST["req_desc"].'" size="40"></td>'; print '<td><input type="text" class="flat" name="req_desc" value="'.$_POST["req_desc"].'" size="40"></td>';
print '<td align="right"><input type="text" class="flat" name="req_debit" value="'.$_POST["req_debit"].'" size="6"></td>'; print '<td align="right"><input type="text" class="flat" name="req_debit" value="'.$_POST["req_debit"].'" size="6"></td>';
print '<td align="right"><input type="text" class="flat" name="req_credit" value="'.$_POST["req_credit"].'" size="6"></td>'; print '<td align="right"><input type="text" class="flat" name="req_credit" value="'.$_POST["req_credit"].'" size="6"></td>';
@ -300,7 +308,7 @@ if ($account > 0)
$total = _print_lines($db, $result, $sql, $acct); $total = _print_lines($db, $result, $sql, $acct);
if ($page == 0) if ($page == 0)
{ {
print '<tr class="liste_total"><td align="right" colspan="6">'.$langs->trans("Balance").'</td>'; print '<tr class="liste_total"><td align="left" colspan="6">'.$langs->trans("CurrentBalance").'</td>';
print '<td align="right" nowrap>'.price($total).'</td>'; print '<td align="right" nowrap>'.price($total).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -311,11 +319,12 @@ if ($account > 0)
print "</table>"; print "</table>";
print "\n</div>\n";
/* /*
* Boutons actions * Boutons actions
*/ */
if ($_GET["action"] != 'rappro') if ($_GET["action"] != 'addline')
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
@ -326,7 +335,7 @@ if ($account > 0)
if ($user->rights->banque->modifier) if ($user->rights->banque->modifier)
{ {
print '<a class="tabAction" href="account.php?action=rappro&amp;account='.$acct->id.'&amp;page='.$page.'">'.$langs->trans("AddBankRecord").'</a>'; print '<a class="tabAction" href="account.php?action=addline&amp;account='.$acct->id.'&amp;page='.$page.'">'.$langs->trans("AddBankRecord").'</a>';
} }
print '</div>'; print '</div>';

View File

@ -29,6 +29,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
if (!$user->rights->banque->lire) accessforbidden(); if (!$user->rights->banque->lire) accessforbidden();
@ -44,6 +45,13 @@ else
$year_end=$year_start+2; $year_end=$year_start+2;
} }
// Sécurité accés client
if ($user->societe_id > 0)
{
$socidp = $user->societe_id;
}
llxHeader(); llxHeader();
@ -51,17 +59,6 @@ llxHeader();
$acct = new Account($db); $acct = new Account($db);
$acct->fetch($_GET["account"]); $acct->fetch($_GET["account"]);
/*
* Sécurité accés client
*/
if ($user->societe_id > 0)
{
$socidp = $user->societe_id;
}
$title=$langs->trans("IOMonthlyReporting").", ".$langs->trans("FinancialAccount")." : <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) # Ce rapport de trésorerie est basé sur llx_bank (car doit inclure les transactions sans facture)
# plutot que sur llx_paiement + llx_paiementfourn # plutot que sur llx_paiement + llx_paiementfourn
@ -83,7 +80,9 @@ if ($resql)
$encaiss[$row[1]] = $row[0]; $encaiss[$row[1]] = $row[0];
$i++; $i++;
} }
} else { }
else
{
dolibarr_print_error($db); dolibarr_print_error($db);
} }
@ -103,11 +102,22 @@ if ($resql)
$decaiss[$row[1]] = -$row[0]; $decaiss[$row[1]] = -$row[0];
$i++; $i++;
} }
} else { }
else
{
dolibarr_print_error($db); dolibarr_print_error($db);
} }
$title=$langs->trans("FinancialAccount")." : ".$acct->label;
$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);
// Onglets
$head=bank_prepare_head($acct);
dolibarr_fiche_head($head,'annual',$langs->trans("FinancialAccount"),0);
// Affiche tableau // Affiche tableau
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td rowspan=2>'.$langs->trans("Month").'</td>'; print '<tr class="liste_titre"><td rowspan=2>'.$langs->trans("Month").'</td>';
@ -169,7 +179,6 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
$nbcol+=2; $nbcol+=2;
} }
print "</tr>\n"; print "</tr>\n";
print '<td colspan="'.$nbcol.'">&nbsp;</td>';
// Solde actuel // Solde actuel
$balance=0; $balance=0;
@ -191,6 +200,7 @@ print "</tr>\n";
print "</table>"; print "</table>";
print "\n</div>\n";
$db->close(); $db->close();

View File

@ -1,86 +0,0 @@
<?php
/* Copyright (C) 2000,2001 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* $Id$
* $Source$
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/
*/
/*! \file htdocs/compta/bank/bank.lib.php
\ingroup banque
\brief librairie contenant les fonctions bancaires.
\author Laurent Destailleur
\version $Revision$
Ensemble des fonctions en rapport avec les modules bancaires
*/
/*!
\brief Verifie le RIB d'un compte bancaire grace à sa clé
\param code_banque code banque
\param code_guichet code guichet
\param num_compte numero de compte
\param cle cle
\param iban Ne sert pas pour le calcul de cle mais sert pour determiner le pays
\return int true si les infos sont bonnes, false si la clé ne correspond pas
*/
function verif_rib($code_banque , $code_guichet , $num_compte , $cle, $iban)
{
if (eregi("^FR",$iban))
{ // Cas de la France
$coef = array(62, 34, 3) ;
// Concatenation des differents codes.
$rib = strtolower(trim($code_banque).trim($code_guichet).trim($num_compte).trim($cle));
// On remplace les eventuelles lettres par des chiffres.
//Ne marche pas
//$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz","12345678912345678912345678");
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz","12345678912345678923456789");
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
// Multiplication de chaque groupe par les coef du tableau
for ($i=0, $s=0; $i<3; $i++)
{
$code = substr($rib, 7 * $i, 7) ;
$s += (0 + $code) * $coef[$i] ;
}
// Soustraction du modulo 97 de $s à 97 pour obtenir la clé RIB
$cle_rib = 97 - ($s % 97) ;
if ($cle_rib == $cle)
{
return true;
}
return false;
}
return true;
}
?>

View File

@ -29,6 +29,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
$langs->load("banks"); $langs->load("banks");
@ -103,21 +104,11 @@ $form = new Form($db);
/* /*
* Affichage onglets * Affichage onglets
*/ */
$h=0; $titre=$langs->trans("FinancialAccount")." : ".$account->label;
print_fiche_titre($titre,$mesg);
$head[$h][0] = 'fiche.php?id='.$account->id;
$head[$h][1] = $langs->trans("AccountCard");
$head[$h][2] = 'bankname';
$h++;
if ($account->type == 0 || $account->type == 1)
{
$head[$h][0] = 'bankid_fr.php?id='.$account->id;
$head[$h][1] = $langs->trans("RIB");
$head[$h][2] = 'bankid';
$h++;
}
// Onglets
$head=bank_prepare_head($account);
dolibarr_fiche_head($head, 'bankid', $langs->trans("FinancialAccount")); dolibarr_fiche_head($head, 'bankid', $langs->trans("FinancialAccount"));
/* /*
@ -186,7 +177,7 @@ $form = new Form($db);
print '</table>'; print '</table>';
print '</div>'; print "\n</div>\n";
/* /*

View File

@ -21,7 +21,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require("./bank.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
$user->getrights('compta'); $user->getrights('compta');

View File

@ -28,11 +28,12 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require("./bank.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
if (!$user->rights->banque->configurer) if (!$user->rights->banque->configurer)
accessforbidden(); accessforbidden();
llxHeader(); llxHeader();
print_titre($langs->trans("AccountSetup")); print_titre($langs->trans("AccountSetup"));

View File

@ -29,6 +29,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
$langs->load("banks"); $langs->load("banks");
@ -215,8 +216,11 @@ if ($_GET["action"] == 'create')
print '<tr><td valign="top">'.$langs->trans("Web").'</td>'; print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$_POST["url"].'"></td></tr>'; print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$_POST["url"].'"></td></tr>';
// Comment
print '<tr><td valign="top">'.$langs->trans("Comment").'</td>'; print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
print '<td colspan="3"><textarea cols="70" class="flat" name="account_comment">'.$account->comment.'</textarea></td></tr>'; print '<td colspan="3">';
print '<textarea cols="70" class="flat" name="account_comment">'.$account->comment.'</textarea>';
print '</td></tr>';
// Solde // Solde
print '<tr><td colspan="4"><b>'.$langs->trans("InitialBankBalance").'...</b></td></tr>'; print '<tr><td colspan="4"><b>'.$langs->trans("InitialBankBalance").'...</b></td></tr>';
@ -254,21 +258,11 @@ else
/* /*
* Affichage onglets * Affichage onglets
*/ */
$h=0; $titre=$langs->trans("FinancialAccount")." : ".$account->label;
print_fiche_titre($titre,$mesg);
$head[$h][0] = 'fiche.php?id='.$account->id;
$head[$h][1] = $langs->trans("AccountCard");
$head[$h][2] = 'bankname';
$h++;
if ($account->type == 0 || $account->type == 1)
{
$head[$h][0] = 'bankid_fr.php?id='.$account->id;
$head[$h][1] = $langs->trans("RIB");
$head[$h][2] = 'bankid';
$h++;
}
// Onglets
$head=bank_prepare_head($account);
dolibarr_fiche_head($head, 'bankname', $langs->trans("FinancialAccount")); dolibarr_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"));
/* /*
@ -433,13 +427,16 @@ else
print '<tr><td valign="top">'.$langs->trans("BalanceMinimalDesired").'</td>'; print '<tr><td valign="top">'.$langs->trans("BalanceMinimalDesired").'</td>';
print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.$account->min_desired.'"></td></tr>'; print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.$account->min_desired.'"></td></tr>';
// Web
print '<tr><td valign="top">'.$langs->trans("Web").'</td>'; print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$account->url.'">'; print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$account->url.'">';
print '</td></tr>'; print '</td></tr>';
// Comment
print '<tr><td valign="top">'.$langs->trans("Comment").'</td>'; print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
print '<td colspan="3"><textarea cols="70" class="flat" name="account_comment">'.$account->comment.'</textarea></td></tr>'; print '<td colspan="3">';
print '<textarea cols="70" class="flat" name="account_comment">'.$account->comment.'</textarea>';
print '</td></tr>';
print '<tr><td align="center" colspan="4"><input value="'.$langs->trans("Modify").'" type="submit" class="button">'; print '<tr><td align="center" colspan="4"><input value="'.$langs->trans("Modify").'" type="submit" class="button">';
print ' &nbsp; <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button">'; print ' &nbsp; <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button">';

View File

@ -26,18 +26,19 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
if (!$user->rights->banque->lire) if (!$user->rights->banque->lire)
accessforbidden(); accessforbidden();
$account = $_GET["account"];
llxHeader(); llxHeader();
$account = $_GET["id"];
if ($account > 0) if ($account > 0)
{ {
$datetime = time(); $datetime = time();
$month = strftime("%m", $datetime); $month = strftime("%m", $datetime);
$year = strftime("%Y", $datetime); $year = strftime("%Y", $datetime);
@ -45,14 +46,19 @@ if ($account > 0)
$acct = new Account($db); $acct = new Account($db);
$acct->fetch($account); $acct->fetch($account);
print_fiche_titre("Journal de trésorerie du compte: " .$acct->getNomUrl(0),$mesg);
$titre=$langs->trans("FinancialAccount")." : ".$acct->label;
print_fiche_titre($titre,$mesg);
// Onglets
$head=bank_prepare_head($acct);
dolibarr_fiche_head($head,'graph',$langs->trans("FinancialAccount"),0);
print '<table class="notopnoleftnoright" width="100%">'; print '<table class="notopnoleftnoright" width="100%">';
print '<tr><td>'; print '<tr><td>';
$file = "solde.$account.$year.png"; $file = "solde.$account.$year.png";
/* Bug if (! file_exists($conf->banque->dir_images."/".$file))
if (! file_exists($conf->$file))
{ {
print "Pour générer ou regénérer les graphiques, lancer le script ./scripts/banque/graph-solde.php en ligne de commande.<br>"; print "Pour générer ou regénérer les graphiques, lancer le script ./scripts/banque/graph-solde.php en ligne de commande.<br>";
print '<br>'; print '<br>';
@ -61,7 +67,7 @@ if ($account > 0)
{ {
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank&file='.$file.'" alt="" title="">'; print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank&file='.$file.'" alt="" title="">';
} }
*/
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank&file='.$file.'" alt="" title="">'; print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank&file='.$file.'" alt="" title="">';
print '</td></tr><tr><td>'; print '</td></tr><tr><td>';
@ -77,5 +83,8 @@ if ($account > 0)
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank&file='.$file.'" alt="" title="">'; print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank&file='.$file.'" alt="" title="">';
print '</td></tr></table>'; print '</td></tr></table>';
print "\n</div>\n";
} }
?> ?>

View File

@ -27,10 +27,8 @@
\version $Revision$ \version $Revision$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
require("./bank.lib.php");
require("../../tva.class.php"); require("../../tva.class.php");
require("../../chargesociales.class.php"); require("../../chargesociales.class.php");

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -19,7 +19,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@ -58,8 +57,9 @@ function llxHeader($head = "")
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$menu->add(DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid, $objp->label); $menu->add(DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid, $objp->label);
if ($objp->courant != 2) $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 ,$langs->trans("IOMonthlyReporting")); $menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
$menu->add_submenu(DOL_URL_ROOT."/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
if ($objp->courant != 2) $menu->add_submenu(DOL_URL_ROOT."/compta/bank/releve.php?account=".$objp->rowid ,$langs->trans("AccountStatements"));
$i++; $i++;
} }
} }

View File

@ -28,6 +28,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
$langs->load("companies"); $langs->load("companies");
@ -49,6 +50,18 @@ if ($_GET["action"] == 'dvprev')
} }
$sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
$sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
$page=isset($_GET["page"])?$_GET["page"]:$_POST["page"];
if ($page == -1) { $page = 0; }
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="s.nom";
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
llxHeader(); llxHeader();
@ -60,20 +73,12 @@ if (! isset($_GET["num"]))
{ {
/* /*
* Vue liste tous relevés confondus * Vue liste tous relevés confondus
*
*/ */
if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$sql = "SELECT distinct(b.num_releve) as numr"; $sql = "SELECT distinct(b.num_releve) as numr";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= " WHERE fk_account = ".$_GET["account"]; $sql.= " WHERE fk_account = ".$_GET["account"];
$sql.= " ORDER BY numr DESC"; $sql.= " ORDER BY numr DESC";
// $sql .= $db->plimit($limit,$offset); // retrait de la limite tant qu'il n'y a pas de pagination $sql.= $db->plimit($conf->liste_limit+1,$offset);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
@ -82,15 +87,19 @@ if (! isset($_GET["num"]))
$numrows = $db->num_rows($result); $numrows = $db->num_rows($result);
$i = 0; $i = 0;
print_barre_liste($langs->trans("AccountStatements").", ".$langs->trans("BankAccount")." : <a href=\"account.php?account=".$acct->id."\">".$acct->label."</a>", $page, "releve.php","&amp;account=".$_GET["account"],$sortfield,$sortorder,'',$numrows); $titre=$langs->trans("FinancialAccount")." : ".$acct->label;
print '<br>'; print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], "&amp;account=".$_GET["account"], $sortfield, $sortorder,'',$numrows);
// Onglets
$head=bank_prepare_head($acct);
dolibarr_fiche_head($head,'statement',$langs->trans("FinancialAccount"),0);
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td>'.$langs->trans("AccountStatement").'</td></tr>'; print '<td>'.$langs->trans("AccountStatement").'</td></tr>';
//while ($i < min($numrows,$limit)) // retrait de la limite tant qu'il n'y a pas de pagination //while ($i < min($numrows,$conf->liste_limit)) // retrait de la limite tant qu'il n'y a pas de pagination
while ($i < min($numrows,$limit)) while ($i < min($numrows,$conf->liste_limit))
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var=!$var; $var=!$var;
@ -105,9 +114,13 @@ if (! isset($_GET["num"]))
$i++; $i++;
} }
print "</table>\n"; print "</table>\n";
print "\n</div>\n";
}
else
{
dolibarr_print_error($db);
} }
} }
else else
{ {
@ -163,7 +176,7 @@ else
$mesprevnext ="<a href=\"releve.php?rel=prev&amp;num=$num&amp;ve=$ve&amp;account=$acct->id\">".img_previous()."</a> &nbsp;"; $mesprevnext ="<a href=\"releve.php?rel=prev&amp;num=$num&amp;ve=$ve&amp;account=$acct->id\">".img_previous()."</a> &nbsp;";
$mesprevnext.= $langs->trans("AccountStatement")." $num"; $mesprevnext.= $langs->trans("AccountStatement")." $num";
$mesprevnext.=" &nbsp; <a href=\"releve.php?rel=next&amp;num=$num&amp;ve=$ve&amp;account=$acct->id\">".img_next()."</a>"; $mesprevnext.=" &nbsp; <a href=\"releve.php?rel=next&amp;num=$num&amp;ve=$ve&amp;account=$acct->id\">".img_next()."</a>";
print_fiche_titre($langs->trans("AccountStatement").' '.$num.', '.$langs->trans("BankAccount").' : <a href="account.php?account='.$acct->id.'">'.$acct->label.'</a>',$mesprevnext); print_fiche_titre($langs->trans("AccountStatement").' '.$num.', '.$langs->trans("BankAccount").' : '.$acct->getNomUrl(0),$mesprevnext);
print '<br>'; print '<br>';
print "<form method=\"post\" action=\"releve.php\">"; print "<form method=\"post\" action=\"releve.php\">";
@ -181,7 +194,7 @@ else
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
// Calcul du solde de départ du relevé // Calcul du solde de départ du relev
$sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank"; $sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank";
$sql.= " WHERE num_releve < ".$num." AND fk_account = ".$acct->id; $sql.= " WHERE num_releve < ".$num." AND fk_account = ".$acct->id;
$resql=$db->query($sql); $resql=$db->query($sql);
@ -192,7 +205,7 @@ else
$db->free($resql); $db->free($resql);
} }
// Recherche les écritures pour le relevé // Recherche les écritures pour le relev
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type"; $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql .= " WHERE num_releve='".$num."'"; $sql .= " WHERE num_releve='".$num."'";
@ -346,6 +359,7 @@ else
print "<tr><td align=\"right\" colspan=\"4\">&nbsp;</td><td align=\"right\" colspan=\"2\"><b>".$langs->trans("EndBankBalance")." :</b></td><td align=\"right\"><b>".price($total)."</b></td><td>&nbsp;</td></tr>\n"; print "<tr><td align=\"right\" colspan=\"4\">&nbsp;</td><td align=\"right\" colspan=\"2\"><b>".$langs->trans("EndBankBalance")." :</b></td><td align=\"right\"><b>".price($total)."</b></td><td>&nbsp;</td></tr>\n";
print "</table></form>\n"; print "</table></form>\n";
} }
$db->close(); $db->close();
llxFooter('$Date$ - $Revision$'); llxFooter('$Date$ - $Revision$');

View File

@ -28,7 +28,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require("./bank.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
$user->getrights('banque'); $user->getrights('banque');

View File

@ -28,7 +28,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require("./bank.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
$user->getrights('banque'); $user->getrights('banque');

View File

@ -86,3 +86,4 @@ DateConciliating=Conciliate date
BankLineConciliated=Transaction conciliated BankLineConciliated=Transaction conciliated
CustomerInvoicePayment=Customer payment CustomerInvoicePayment=Customer payment
SupplierInvoicePayment=Supplier payment SupplierInvoicePayment=Supplier payment
FinancialAccountJournal=Financial account journal

View File

@ -86,3 +86,4 @@ DateConciliating=Date rapprochement
BankLineConciliated=Ecriture rapprochée BankLineConciliated=Ecriture rapprochée
CustomerInvoicePayment=Règlement client CustomerInvoicePayment=Règlement client
SupplierInvoicePayment=Règlement fournisseur SupplierInvoicePayment=Règlement fournisseur
FinancialAccountJournal=Journal de trésorerie du compte

View File

@ -234,10 +234,11 @@ function dolibarr_syslog($message, $level=LOG_INFO)
\param links Tableau de titre d'onglets \param links Tableau de titre d'onglets
\param active 0=onglet non actif, 1=onglet actif \param active 0=onglet non actif, 1=onglet actif
\param title Titre tabelau ("" par defaut) \param title Titre tabelau ("" par defaut)
\param notab 0=Add tab header, 1=no tab header
*/ */
function dolibarr_fiche_head($links, $active='0', $title='') function dolibarr_fiche_head($links, $active='0', $title='', $notab=0)
{ {
print '<div class="tabs">'."\n"; print "\n".'<div class="tabs">'."\n";
// Affichage titre // Affichage titre
if ($title) if ($title)
@ -275,7 +276,7 @@ function dolibarr_fiche_head($links, $active='0', $title='')
print "</div>\n"; print "</div>\n";
print '<div class="tabBar">'."\n\n"; if (! $notab) print '<div class="tabBar">'."\n\n";
} }
/** /**
@ -1580,7 +1581,7 @@ function dol_delete_dir($dir)
\param titre titre de la page \param titre titre de la page
\param page numéro de la page \param page numéro de la page
\param file lien \param file lien
\param options options cellule td ('' par defaut) \param options parametres complementaires lien ('' par defaut)
\param sortfield champ de tri ('' par defaut) \param sortfield champ de tri ('' par defaut)
\param sortorder ordre de tri ('' par defaut) \param sortorder ordre de tri ('' par defaut)
\param center chaine du centre ('' par defaut) \param center chaine du centre ('' par defaut)
@ -1603,7 +1604,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
if ($page > 0 || $num > $conf->liste_limit) if ($page > 0 || $num > $conf->liste_limit)
{ {
print '<tr><td><div class="titre">'.$titre.' - page '.($page+1); print '<tr><td class="notopnoleftnoright"><div class="titre">'.$titre.' - page '.($page+1);
print '</div></td>'; print '</div></td>';
} }
else else

View File

@ -31,7 +31,7 @@ require("../../conf/conf.php");
header('Content-type: text/css'); header('Content-type: text/css');
// Important: Avoid page request by browser and dynamic build at // Important: Avoid page request by browser and dynamic build at
// each Dolibarr page access. // each Dolibarr page access.
header('Cache-Control: max-age=3600, must-revalidate'); header('Cache-Control: max-age=3600, public, must-revalidate');
?> ?>

View File

@ -565,7 +565,7 @@ foreach ($accounts as $account)
$graph->Add($bg); $graph->Add($bg);
$graph->img->SetImgFormat("png"); $graph->img->SetImgFormat("png");
$file= DOL_DATA_ROOT."/graph/banque/mouvement.$account.$year.png"; $file= $conf->banque->dir_images."/mouvement.$account.$year.png";
$graph->Stroke($file); $graph->Stroke($file);
} }