/[dolibarr]/dolibarr/htdocs/compta/bank/index.php
ViewVC logotype

Diff of /dolibarr/htdocs/compta/bank/index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.28 by eldy, Sat May 7 21:56:12 2005 UTC revision 1.29 by rodolphe, Tue Aug 2 14:52:04 2005 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>  /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
4   *   *
5   * This program is free software; you can redistribute it and/or modify   * This program is free software; you can redistribute it and/or modify
# Line 22  Line 22 
22   */   */
23    
24  /**  /**
25              \file       htdocs/compta/bank/index.php     \file       htdocs/compta/bank/index.php
26          \ingroup    banque     \ingroup    banque
27                  \brief      Page accueil banque     \brief      Page accueil banque
28                  \version    $Revision$     \version    $Revision$
29  */  */
30    
31    
# Line 43  $user->getrights('banque'); Line 43  $user->getrights('banque');
43  if (!$user->rights->banque->lire)  if (!$user->rights->banque->lire)
44    accessforbidden();    accessforbidden();
45    
   
   
46  llxHeader();  llxHeader();
47    
   
48  print_titre($langs->trans("AccountsArea"));  print_titre($langs->trans("AccountsArea"));
49  print '<br>';  print '<br>';
50    
51    
52  // On charge tableau des comptes financiers  // On charge tableau des comptes financiers ouverts
53    // On n'affiche pas les comptes clos
54  $accounts = array();  $accounts = array();
55    
56  $sql = "SELECT rowid, courant";  $sql  = "SELECT rowid, courant";
57  $sql.= " FROM ".MAIN_DB_PREFIX."bank_account";  $sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
58  $sql.= " ORDER BY label";  $sql .= " WHERE clos = 0";
59    $sql .= " ORDER BY label";
60    
61  $result = $db->query($sql);  $resql = $db->query($sql);
62  if ($result)  if ($resql)
63  {  {
64    $num = $db->num_rows($result);    $num = $db->num_rows($resql);
65    $i = 0;    $i = 0;
66    while ($i < $num) {    while ($i < $num)
67      $objp = $db->fetch_object($result);      {
68      $accounts[$objp->rowid] = $objp->courant;        $objp = $db->fetch_object($resql);
69      $i++;        $accounts[$objp->rowid] = $objp->courant;
70    }        $i++;
71    $db->free($result);      }
72      $db->free($resql);
73  }  }
74    
75    
# Line 92  foreach ($accounts as $key=>$type) Line 92  foreach ($accounts as $key=>$type)
92                
93        $var = !$var;        $var = !$var;
94        $solde = $acc->solde();        $solde = $acc->solde();
95            
96        print "<tr ".$bc[$var]."><td>";        print "<tr ".$bc[$var]."><td>";
97        print '<a href="account.php?account='.$acc->id.'">'.$acc->label.'</a>';        print '<a href="account.php?account='.$acc->id.'">'.$acc->label.'</a>';
98        print "</td><td>$acc->bank</td><td>$acc->number</td>";        print "</td><td>$acc->bank</td><td>$acc->number</td>";
99        print '<td align="right">'.price($solde).'</td><td align="center">'.$yn[$acc->clos].'</td></tr>';        print '<td align="right">'.price($solde).'</td><td align="center">'.$yn[$acc->clos].'</td></tr>';
100            
101        $total += $solde;        $total += $solde;
102      }      }
103  }  }

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26