diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php
index 1251e2723f1..bcc801b1e4b 100644
--- a/htdocs/compta/bank/account.class.php
+++ b/htdocs/compta/bank/account.class.php
@@ -632,6 +632,26 @@ class Account
}
}
+
+ /**
+ * \brief Renvoie nom clicable (avec eventuellement le picto)
+ * \param withpicto Inclut le picto dans le lien
+ * \return string Chaine avec URL
+ */
+ function getNomUrl($withpicto=0)
+ {
+ global $langs;
+
+ $result='';
+
+ $lien = '';
+ $lienfin='';
+
+ if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAccount"),'account').$lienfin.' ');
+ $result.=$lien.$this->label.$lienfin;
+ return $result;
+ }
+
}
@@ -740,7 +760,7 @@ class AccountLine
dolibarr_print_error($this->db);
}
}
-
+
}
?>
diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php
index e4b969ea0fd..1eac64c7b53 100644
--- a/htdocs/compta/bank/budget.php
+++ b/htdocs/compta/bank/budget.php
@@ -51,7 +51,10 @@ if ($_GET["bid"] == 0)
print '
';
print "";
- print '| '.$langs->trans("Description").' | '.$langs->trans("Nb").' | '.$langs->trans("Total").' | '.$langs->trans("Average").' | ';
+ print ''.$langs->trans("Description").' | ';
+ print ''.$langs->trans("Nb").' | ';
+ print ''.$langs->trans("Total").' | ';
+ print ''.$langs->trans("Average").' | ';
print "
\n";
$sql = "SELECT sum(d.amount) as somme, count(*) as nombre, c.label, c.rowid ";
@@ -71,9 +74,9 @@ if ($_GET["bid"] == 0)
$var=!$var;
print "";
print "| rowid\">$objp->label | ";
- print ''.$objp->nombre.' | ';
- print "".price(abs($objp->somme))." | ";
- print "".price(abs($objp->somme / $objp->nombre))." | ";
+ print ''.$objp->nombre.' | ';
+ print ''.price(abs($objp->somme))." | ";
+ print ''.price(abs($objp->somme / $objp->nombre))." | ";
print "
";
$i++;
$total = $total + abs($objp->somme);
diff --git a/htdocs/compta/bank/config.php b/htdocs/compta/bank/config.php
index 1c317f63532..bfc90c1efe3 100644
--- a/htdocs/compta/bank/config.php
+++ b/htdocs/compta/bank/config.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
@@ -21,10 +21,10 @@
*/
/**
- \file htdocs/compta/bank/config.php
- \ingroup banque
- \brief Page de configuration des comptes bancaires
- \version $Revision$
+ \file htdocs/compta/bank/config.php
+ \ingroup banque
+ \brief Page de configuration des comptes bancaires
+ \version $Revision$
*/
require("./pre.inc.php");
@@ -42,7 +42,7 @@ print '';
print '| '.$langs->trans("Ref")." | ".$langs->trans("Type")." | ".$langs->trans("Bank").' | ';
print ''.$langs->trans("AccountIdShort").' | ';
print ''.$langs->trans("Conciliable").' | ';
-print ''.$langs->trans("Status").' | ';
+print ''.$langs->trans("Status").' | ';
print "
\n";
$sql = "SELECT rowid, label, number, bank, courant as type, clos, rappro";
@@ -53,27 +53,31 @@ $result = $db->query($sql);
$var=false;
if ($result)
{
- $account=new Account($db);
-
- $var=True;
- $num = $db->num_rows($result);
- $i = 0; $total = 0;
-
- $sep = 0;
-
- while ($i < $num) {
- $objp = $db->fetch_object($result);
-
- $var=!$var;
- print '| '.img_object($langs->trans("ShowAccount"),'account').' '.$objp->label.' | ';
- print ''.$account->type_lib[$objp->type].' | ';
- print ''.$objp->bank.' | '.$objp->number.' | ';
- print ''.yn($objp->rappro).' | ';
- print ''.$account->status[$objp->clos].' |
';
-
- $i++;
- }
- $db->free($result);
+ $accountstatic=new Account($db);
+
+ $var=True;
+ $num = $db->num_rows($result);
+ $i = 0; $total = 0;
+
+ $sep = 0;
+
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object($result);
+
+ $var=!$var;
+ print '';
+ $accountstatic->id=$objp->rowid;
+ $accountstatic->label=$objp->label;
+ print '| '.$accountstatic->getNomUrl(1).' | ';
+ print ''.$accountstatic->type_lib[$objp->type].' | ';
+ print ''.$objp->bank.' | '.$objp->number.' | ';
+ print ''.yn($objp->rappro).' | ';
+ print ''.$accountstatic->LibStatut($objp->clos,5).' |
';
+
+ $i++;
+ }
+ $db->free($result);
}
print "
";
diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php
index 2f3766d3d82..5ac67e8c71b 100644
--- a/htdocs/compta/bank/fiche.php
+++ b/htdocs/compta/bank/fiche.php
@@ -326,7 +326,7 @@ else
}
print '| '.$langs->trans("Web").' | ';
- print ''.$account->url.'';
+ print ''.$account->url.'';
print " |
\n";
print '';
diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php
index b1c2bb20059..b2a77691130 100644
--- a/htdocs/compta/bank/index.php
+++ b/htdocs/compta/bank/index.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
@@ -87,7 +87,7 @@ print '';
print '| '.$langs->trans("CurrentAccounts").' | ';
print ''.$langs->trans("Bank").' | ';
print ''.$langs->trans("AccountIdShort").' | ';
-print ''.$langs->trans("Conciliable").' | ';
+print ''.$langs->trans("Conciliable").' | ';
print ''.$langs->trans("Status").' | ';
print ''.$langs->trans("BankBalance").' | ';
print "
\n";
@@ -96,24 +96,27 @@ $total = 0;
$var=true;
foreach ($accounts as $key=>$type)
{
- if ($type == 1)
- {
- $acc = new Account($db);
- $acc->fetch($key);
-
- $var = !$var;
- $solde = $acc->solde();
-
- print '| ';
- print ''.img_object($langs->trans("ShowAccount"),'account').' '.$acc->label.'';
- print ' | '.$acc->bank." | $acc->number | ";
- print ''.yn($acc->rappro).' | ';
- print ''.$acc->status[$acc->clos].' | ';
- print ''.price($solde).' | ';
- print '
';
-
- $total += $solde;
- }
+ if ($type == 1)
+ {
+ $acc = new Account($db);
+ $acc->fetch($key);
+
+ $var = !$var;
+ $solde = $acc->solde();
+
+ print '';
+ print '| '.$acc->getNomUrl(1).' | ';
+ print ''.$acc->bank.' | ';
+ print ''.$acc->number.' | ';
+ print ''.yn($acc->rappro).' | ';
+ print ''.$acc->getLibStatut(2).' | ';
+ print '';
+ print ''.price($solde).'';
+ print ' | ';
+ print '
';
+
+ $total += $solde;
+ }
}
// Total
@@ -126,10 +129,11 @@ print '| |
';
/*
* Comptes placements
*/
-print '';
-print '| '.$langs->trans("SavingAccounts").' | '.$langs->trans("Bank").' | ';
+print '
';
+print '| '.$langs->trans("SavingAccounts").' | ';
+print ''.$langs->trans("Bank").' | ';
print ''.$langs->trans("Numero").' | ';
-print ''.$langs->trans("Conciliable").' | ';
+print ''.$langs->trans("Conciliable").' | ';
print ''.$langs->trans("Status").' | ';
print ''.$langs->trans("BankBalance").' | ';
print "
\n";
@@ -138,24 +142,27 @@ $total = 0;
$var=true;
foreach ($accounts as $key=>$type)
{
- if ($type == 0)
- {
- $acc = new Account($db);
- $acc->fetch($key);
-
- $var = !$var;
- $solde = $acc->solde();
-
- print "| ";
- print ''.img_object($langs->trans("ShowAccount"),'account').' '.$acc->label.'';
- print " | $acc->bank | $acc->number | ";
- print ''.yn($acc->rappro).' | ';
- print ''.$acc->status[$acc->clos].' | ';
- print ''.price($solde).' | ';
- print '
';
-
- $total += $solde;
- }
+ if ($type == 0)
+ {
+ $acc = new Account($db);
+ $acc->fetch($key);
+
+ $var = !$var;
+ $solde = $acc->solde();
+
+ print "";
+ print '| '.$acc->getNomUrl(1).' | ';
+ print ''.$acc->bank.' | ';
+ print ''.$acc->number.' | ';
+ print ''.yn($acc->rappro).' | ';
+ print ''.$acc->getLibStatut(2).' | ';
+ print '';
+ print ''.price($solde).'';
+ print ' | ';
+ print '
';
+
+ $total += $solde;
+ }
}
// Total
@@ -168,7 +175,6 @@ print '| |
';
/*
* Comptes caisse/liquide
*/
-print '';
print '| '.$langs->trans("CashAccounts").' | | ';
print ' | ';
print ' | ';
@@ -188,13 +194,15 @@ foreach ($accounts as $key=>$type)
$var = !$var;
$solde = $acc->solde();
- print "
| ";
- print ''.img_object($langs->trans("ShowAccount"),'account').' '.$acc->label.'';
- print ' | '.$acc->bank.' | ';
+ print "
";
+ print '| '.$acc->getNomUrl(1).' | ';
+ print ''.$acc->bank.' | ';
print ' | ';
print ' | ';
- print ''.$acc->status[$acc->clos].' | ';
- print ''.price($solde).' | ';
+ print ''.$acc->getLibStatut(2).' | ';
+ print '';
+ print ''.price($solde).'';
+ print ' | ';
print '
';
$total += $solde;
@@ -205,41 +213,6 @@ foreach ($accounts as $key=>$type)
print '| | '.$langs->trans("Total").' | '.price($total).' |
';
-/*
- * Dettes
- */
-print '| |
';
-print '| '.$langs->trans("Debts").' |
';
-
-// TVA
-if ($conf->compta->tva)
-{
- $var=true;
- $var = !$var;
- $tva = new Tva($db);
-
- $tva_solde = $tva->solde();
-
- $total = $total + $tva_solde;
-
- print "".'| '.$langs->trans("VAT").' | '.price($tva_solde).' |
';
-}
-
-
-// Charges sociales
-$var = !$var;
-$chs = new ChargeSociales($db);
-
-$chs_a_payer = $chs->solde();
-
-$total = $total - $chs_a_payer;
-
-print "".'| '.$langs->trans("SocialContributions").' | '.price($chs_a_payer).' |
';
-
-// Total
-print '| | '.$langs->trans("Total").' | '.price($total).' |
';
-
-
print "
";
diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php
index d585d973d1a..6c767228bf2 100644
--- a/htdocs/compta/bank/search.php
+++ b/htdocs/compta/bank/search.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
@@ -92,16 +92,18 @@ print '';
// Compte le nombre total d'écritures
-$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."bank";
-if ($account) { $sql .= " WHERE b.fk_account=$account"; }
+$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."bank";
+if ($account) { $sql .= " WHERE b.fk_account=".$account; }
$resql=$db->query($sql);
if ($resql)
{
- $nbline = $db->result (0, 0);
+ $obj = $db->fetch_object($resql);
+ $nbline = $obj->nb;
$db->free($resql);
}
-else {
+else
+{
dolibarr_print_error($db);
}
@@ -164,7 +166,7 @@ if ($result)
$var=!$var;
print "";
- print "| ".strftime("%d %b %y",$objp->do)." | \n";
+ print "".dolibarr_print_date($objp->do,"%d %b %y")." | \n";
print "rowid&account=$objp->fk_account\">$objp->label ";
|