diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index e8062c24bf0..80063612db4 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -23,7 +23,7 @@ * */ -/*! \file htdocs/compta/bank/account.php +/** \file htdocs/compta/bank/account.php \ingroup banque \brief Page de détail des transactions bancaires \version $Revision$ @@ -187,30 +187,10 @@ if ($account > 0) $mesg.= ''.img_next().''; } print_fiche_titre("Journal de trésorerie du compte : " .$acct->label,$mesg); - print '
'; - print '
'; - print ''; - print ''; - print ''; - print ""; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - print "\n"; + + print '
'; + print '
 '; - if ($user->rights->banque->modifier) - { - print 'Rappro'; - } - else - { - print " "; - } - print '
'; /* * Affiche tableau des transactions bancaires @@ -226,8 +206,30 @@ if ($account > 0) print ''; print ''; - print ''; - print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + print "\n"; /* Another solution * create temporary table solde type=heap select amount from llx_bank limit 100 ; @@ -266,18 +268,24 @@ if ($account > 0) _print_lines($db, $sql, $acct); } + /* * Formulaire de saisie d'une opération hors factures * */ if ($user->rights->banque->modifier) { - print "\n"; + print "\n"; + print ""; print ""; print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; - print ''; - print ''; - print ''; - print ''; } + print "
Date OpeValeur'.$langs->trans("Type").''.$langs->trans("Description").'DébitCréditSoldeRelevé
'.$langs->trans("Debit").''.$langs->trans("Credit").'Solde'.$langs->trans("AccountStatement").'
 '; + if ($user->rights->banque->modifier) + { + print ''.$langs->trans("Rappro").''; + } + else + { + print " "; + } + print '
 
 
Saisie d'une transaction hors facture
'; - print 'YYYY MMDD '.$langs->trans("Description").'0000.000000.00
'; + print '"; print ""; print '
YYYY MMDD '.$langs->trans("Description").'0000.000000.00
"; if ($user->rights->banque->modifier) { diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index 2f1f9810784..2d5a64a2e8f 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * 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 @@ -20,7 +20,7 @@ * $Source$ */ -/*! \file htdocs/compta/bank/rappro.php +/** \file htdocs/compta/bank/rappro.php \ingroup banque \brief Page de rapprochement bancaire \version $Revision$ @@ -95,22 +95,6 @@ if ($result) { } -// Recupère nom du dernier relevé -$sql = "SELECT max(num_releve) FROM ".MAIN_DB_PREFIX."bank WHERE fk_account=".$_GET["account"]; -if ( $db->query($sql) ) -{ - if ( $db->num_rows() ) - { - $last_releve = $db->result(0, 0); - } - $db->free(); -} -else -{ - dolibarr_print_error($db); -} - - /* * Affichage liste des transactions à rapprocher */ @@ -134,22 +118,52 @@ if ($result) } else { - print_titre('Rapprochement compte bancaire: '.$acct->label.''); + print_titre('Rapprochement compte bancaire : '.$acct->label.''); print '
'; if ($msg) { print "$msg

"; } + // Affiche nom des derniers relevés + $nbmax=5; + $sql = "SELECT distinct num_releve FROM ".MAIN_DB_PREFIX."bank"; + $sql.= " WHERE fk_account=".$_GET["account"]; + $sql.= " ORDER BY num_releve DESC"; + $sql.= " LIMIT ".($nbmax+1); + print $langs->trans("LastAccountStatements").' : '; + $resultr=$db->query($sql); + $liste=""; + if ($resultr) + { + $num=$db->num_rows(); + $i=0; + while (($i < $num) && ($i < $nbmax)) + { + $objr = $db->fetch_object($resultr); + $last_releve = $objr->num_releve; + $i++; + $liste=''.$objr->num_releve.'   '.$liste; + } + if ($num >= $nbmax) $liste="...   ".$liste; + print "$liste"; + if ($num > 0) print '

'; + else print $langs->trans("None").'

'; + } + else + { + dolibarr_print_error($db); + } + print ''; print ""; - print ''; - print ''; + print ''; + print ''; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; print "\n"; } @@ -157,7 +171,7 @@ if ($result) $i = 0; while ($i < $num) { - $objp = $db->fetch_object(); + $objp = $db->fetch_object($result); $var=!$var; print ""; @@ -182,13 +196,13 @@ if ($result) if ($objp->do <= mktime() ) { print ""; - print ""; } else { @@ -237,8 +251,6 @@ if ($result) dolibarr_print_error($db); } -print '
Dernier relevé : '.$last_releve.''; - $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index b193fb02a9f..598bf13eb5a 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * 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 @@ -20,7 +20,7 @@ * $Source$ */ -/*! +/** \file htdocs/compta/bank/releve.php \ingroup banque \brief Page d'affichage d'un relevé @@ -86,7 +86,7 @@ if (! isset($_GET["num"])) print '
Date OpeDate Valeur'.$langs->trans("Date").''.$langs->trans("DateValue").''.$langs->trans("Type").''.$langs->trans("Description").'DebitCreditReleve
(Ex: YYYYMM)
'.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("AccountStatement").'
(Ex: YYYYMM)
'.$langs->trans("Action").'
"; - print ""; + print ""; if ($options) { print "
"; } print "
trans("Rapprocher")."\">"; + print "trans("Rapprocher")."\">"; print "
'; print ""; - print ""; + print ''; while ($i < min($numrows,$limit)) { @@ -153,17 +153,17 @@ else } $ve=$_GET["ve"]; - $mesprevnext ="id\">".img_previous().""; - $mesprevnext.=" Relevé $num "; - $mesprevnext.="id\">".img_next().""; - print_fiche_titre('Relevé numéro '.$num.', compte : '.$acct->label.'',$mesprevnext); - + $mesprevnext ="id\">".img_previous()."  "; + $mesprevnext.= $langs->trans("AccountStatement")." $num"; + $mesprevnext.="   id\">".img_next().""; + print_fiche_titre($langs->trans("AccountStatement").' '.$num.', '.$langs->trans("BankAccount").' : '.$acct->label.'',$mesprevnext); + print '
'; print ""; print ""; print '
Relevé
'.$langs->trans("AccountStatement").'
'; print ""; - print ''; + print ''; print ''; print ''; print ''; @@ -180,8 +180,8 @@ else $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 WHERE"; - $sql .= " num_releve='".$num."'"; + $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql .= " WHERE num_releve='".$num."'"; if (! $num) { $sql .= " or num_releve is null"; } diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 7f89065a378..b753d661865 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -10,4 +10,9 @@ BIC=BIC number StandingOrders=Standing Orders StandingOrder=Standing Order Withdrawals=Withdrawals -Withdrawal=Withdrawal \ No newline at end of file +Withdrawal=Withdrawal +AccountStatement=Account statement +AccountStatements=Account statements +LastAccountStatements=Last account statements +Rappro=Rappro +Rapprochement=Rapprochement \ No newline at end of file diff --git a/htdocs/langs/fr_FR/banks.lang b/htdocs/langs/fr_FR/banks.lang index 0896ddc464f..bd2e060c71f 100644 --- a/htdocs/langs/fr_FR/banks.lang +++ b/htdocs/langs/fr_FR/banks.lang @@ -10,4 +10,9 @@ BIC=Identifiant BIC StandingOrders=Prélèvements StandingOrder=Prélèvement Withdrawals=Retraits -Withdrawal=Retrait \ No newline at end of file +Withdrawal=Retrait +AccountStatement=Relevé +AccountStatements=Relevés +LastAccountStatements=Derniers relevés bancaires +Rappro=Rappro +Rapprochement=Rapprochement \ No newline at end of file
Date OpeDate Valeur'.$langs->trans("Type").''.$langs->trans("Description").''.$langs->trans("Date").''.$langs->trans("DateValue").''.$langs->trans("Type").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Solde").'