From 7c7fc76c75244a94a19a20c997649b438fec92ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Jun 2006 19:08:13 +0000 Subject: [PATCH] =?UTF-8?q?Traduction=20libell=E9=20g=E9n=E9rique=20Paieme?= =?UTF-8?q?nt=20fournisseur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/bank/budget.php | 104 +++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 47 deletions(-) diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index 0f9f32b6b9d..e4b969ea0fd 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 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 @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -33,60 +32,62 @@ require("./pre.inc.php"); if (!$user->rights->banque->lire) accessforbidden(); -llxHeader(); + /* - * + * Affichage page * */ +llxHeader(); + if ($_GET["bid"] == 0) { - /* - * Liste mouvements par catégories d'écritures financières - */ - print_titre("Ecritures bancaires par catégories"); - print '
'; - - print ''; - print ""; - print ''; - print "\n"; + /* + * Liste mouvements par catégories d'écritures financières + */ + print_titre("Ecritures bancaires par catégories"); + print '
'; - $sql = "SELECT sum(d.amount) as somme, count(*) as nombre, c.label, c.rowid "; - $sql .= " FROM ".MAIN_DB_PREFIX."bank_categ as c, ".MAIN_DB_PREFIX."bank_class as l, ".MAIN_DB_PREFIX."bank as d"; - $sql .= " WHERE d.rowid=l.lineid AND c.rowid = l.fk_categ GROUP BY c.label, c.rowid ORDER BY c.label"; - - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; $total = 0; - - $var=true; - while ($i < $num) + print '
'.$langs->trans("Description").''.$langs->trans("Nb").''.$langs->trans("Total").''.$langs->trans("Average").'
'; + print ""; + print ''; + print "\n"; + + $sql = "SELECT sum(d.amount) as somme, count(*) as nombre, c.label, c.rowid "; + $sql .= " FROM ".MAIN_DB_PREFIX."bank_categ as c, ".MAIN_DB_PREFIX."bank_class as l, ".MAIN_DB_PREFIX."bank as d"; + $sql .= " WHERE d.rowid=l.lineid AND c.rowid = l.fk_categ GROUP BY c.label, c.rowid ORDER BY c.label"; + + $result = $db->query($sql); + if ($result) { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - print ""; - print ''; - print ""; - print ""; - print ""; - $i++; - $total = $total + abs($objp->somme); - } - $db->free($result); + $num = $db->num_rows($result); + $i = 0; $total = 0; - print ''; - print ''; - } - else - { - dolibarr_print_error($db); - } - print "
'.$langs->trans("Description").''.$langs->trans("Nb").''.$langs->trans("Total").''.$langs->trans("Average").'
rowid\">$objp->label'.$objp->nombre.'".price(abs($objp->somme))."".price(abs($objp->somme / $objp->nombre))."
'.$langs->trans("Total").''.price($total).' 
"; + $var=true; + while ($i < $num) + { + $objp = $db->fetch_object($result); + $var=!$var; + print ""; + print "rowid\">$objp->label"; + print ''.$objp->nombre.''; + print "".price(abs($objp->somme)).""; + print "".price(abs($objp->somme / $objp->nombre)).""; + print ""; + $i++; + $total = $total + abs($objp->somme); + } + $db->free($result); + + print ''.$langs->trans("Total").''; + print ''.price($total).' '; + } + else + { + dolibarr_print_error($db); + } + print ""; } else @@ -137,7 +138,16 @@ else print "".dolibarr_print_date($objp->do)."\n"; print "bankid\">$objp->labelcompte"; - print "rowid\">".img_object($langs->trans("ShowPayment"),"payment").' '.$objp->label.''; + + // Description + print "rowid\">".img_object($langs->trans("ShowPayment"),"payment").' '; + $reg=array(); + eregi('\((.+)\)',$objp->label,$reg); // Si texte entouré de parenthèe on tente recherche de traduction + if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]); + else print $objp->label; + print ''; + + // Montant print "".price(0 - $objp->amount)." "; print ""; $i++;