[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * $Id: index.php,v 1.33 2005/10/15 15:32:02 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/bank/index.php,v $ 21 */ 22 23 /** 24 \file htdocs/compta/bank/index.php 25 \ingroup banque 26 \brief Page accueil banque 27 \version $Revision: 1.33 $ 28 */ 29 30 31 require ("./pre.inc.php"); 32 33 require ("./bank.lib.php"); 34 require ("../../tva.class.php"); 35 require ("../../chargesociales.class.php"); 36 37 $langs->load("banks"); 38 39 $user->getrights('compta'); 40 $user->getrights('banque'); 41 42 if (!$user->rights->banque->lire) 43 accessforbidden(); 44 45 $statut=isset($_GET["statut"])?$_GET["statut"]:''; 46 47 48 llxHeader(); 49 50 51 $link=''; 52 if ($statut == '') $link='<a href="'.$_SERVER["PHP_SELF"].'?statut=all">'.$langs->trans("IncludeClosedAccount").'</a>'; 53 if ($statut == 'all') $link='<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("OnlyOpenedAccount").'</a>'; 54 print_fiche_titre($langs->trans("AccountsArea"),$link); 55 print '<br>'; 56 57 58 // On charge tableau des comptes financiers (ouverts par defaut) 59 $accounts = array(); 60 61 $sql = "SELECT rowid, courant, rappro"; 62 $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; 63 if ($statut != 'all') { 64 $sql .= " WHERE clos = 0"; 65 } 66 $sql .= " ORDER BY label"; 67 68 $resql = $db->query($sql); 69 if ($resql) 70 { 71 $num = $db->num_rows($resql); 72 $i = 0; 73 while ($i < $num) 74 { 75 $objp = $db->fetch_object($resql); 76 $accounts[$objp->rowid] = $objp->courant; 77 $i++; 78 } 79 $db->free($resql); 80 } 81 82 83 /* 84 * Comptes courants 85 */ 86 print '<table class="noborder" width="100%">'; 87 print '<tr class="liste_titre"><td width="30%">'.$langs->trans("CurrentAccounts").'</td>'; 88 print '<td width="20%">'.$langs->trans("Bank").'</td>'; 89 print '<td align="left">'.$langs->trans("AccountIdShort").'</td>'; 90 print '<td align="center" width="100">'.$langs->trans("Conciliable").'</a></td>'; 91 print '<td align="center" width="70">'.$langs->trans("Status").'</td>'; 92 print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>'; 93 print "</tr>\n"; 94 95 $total = 0; 96 $var=true; 97 foreach ($accounts as $key=>$type) 98 { 99 if ($type == 1) 100 { 101 $acc = new Account($db); 102 $acc->fetch($key); 103 104 $var = !$var; 105 $solde = $acc->solde(); 106 107 print '<tr '.$bc[$var].'><td width="30%">'; 108 print '<a href="account.php?account='.$acc->id.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$acc->label.'</a>'; 109 print '</td><td>'.$acc->bank."</td><td>$acc->number</td>"; 110 print '<td align="center">'.yn($acc->rappro).'</td>'; 111 print '<td align="center">'.$acc->status[$acc->clos].'</td>'; 112 print '<td align="right">'.price($solde).'</td>'; 113 print '</tr>'; 114 115 $total += $solde; 116 } 117 } 118 119 // Total 120 print '<tr class="liste_total"><td colspan="4"> </td><td align="center"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td></tr>'; 121 122 123 print '<tr><td colspan="5"> </td></tr>'; 124 125 126 /* 127 * Comptes placements 128 */ 129 print '<table class="noborder" width="100%">'; 130 print '<tr class="liste_titre"><td width="30%">'.$langs->trans("SavingAccounts").'</td><td width="20%">'.$langs->trans("Bank").'</td>'; 131 print '<td align="left">'.$langs->trans("Numero").'</td>'; 132 print '<td align="center" width="100">'.$langs->trans("Conciliable").'</a></td>'; 133 print '<td align="center" width="70">'.$langs->trans("Status").'</td>'; 134 print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>'; 135 print "</tr>\n"; 136 137 $total = 0; 138 $var=true; 139 foreach ($accounts as $key=>$type) 140 { 141 if ($type == 0) 142 { 143 $acc = new Account($db); 144 $acc->fetch($key); 145 146 $var = !$var; 147 $solde = $acc->solde(); 148 149 print "<tr ".$bc[$var]."><td>"; 150 print '<a href="account.php?account='.$acc->id.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$acc->label.'</a>'; 151 print "</td><td>$acc->bank</td><td>$acc->number</td>"; 152 print '<td align="center">'.yn($acc->rappro).'</td>'; 153 print '<td align="center">'.$acc->status[$acc->clos].'</td>'; 154 print '<td align="right">'.price($solde).'</td>'; 155 print '</tr>'; 156 157 $total += $solde; 158 } 159 } 160 161 // Total 162 print '<tr class="liste_total"><td colspan="4"> </td><td align="center"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td></tr>'; 163 164 165 print '<tr><td colspan="5"> </td></tr>'; 166 167 168 /* 169 * Comptes caisse/liquide 170 */ 171 print '<table class="noborder" width="100%">'; 172 print '<tr class="liste_titre"><td width="30%">'.$langs->trans("CashAccounts").'</td><td width="20%"> </td>'; 173 print '<td align="left"> </td>'; 174 print '<td align="left" width="100"> </td>'; 175 print '<td align="center" width="70">'.$langs->trans("Status").'</td>'; 176 print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>'; 177 print "</tr>\n"; 178 179 $total = 0; 180 $var=true; 181 foreach ($accounts as $key=>$type) 182 { 183 if ($type == 2) 184 { 185 $acc = new Account($db); 186 $acc->fetch($key); 187 188 $var = !$var; 189 $solde = $acc->solde(); 190 191 print "<tr ".$bc[$var]."><td>"; 192 print '<a href="account.php?account='.$acc->id.'">'.img_object($langs->trans("ShowAccount"),'account').' '.$acc->label.'</a>'; 193 print '</td><td>'.$acc->bank.'</td>'; 194 print '<td> </td>'; 195 print '<td> </td>'; 196 print '<td align="center">'.$acc->status[$acc->clos].'</td>'; 197 print '<td align="right">'.price($solde).'</td>'; 198 print '</tr>'; 199 200 $total += $solde; 201 } 202 } 203 204 // Total 205 print '<tr class="liste_total"><td colspan="4"> </td><td align="center"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td></tr>'; 206 207 208 /* 209 * Dettes 210 */ 211 print '<tr><td colspan="5"> </td></tr>'; 212 print '<tr class="liste_titre"><td colspan="7">'.$langs->trans("Debts").'</td></tr>'; 213 214 // TVA 215 if ($conf->compta->tva) 216 { 217 $var=true; 218 $var = !$var; 219 $tva = new Tva($db); 220 221 $tva_solde = $tva->solde(); 222 223 $total = $total + $tva_solde; 224 225 print "<tr ".$bc[$var].">".'<td colspan="5">'.$langs->trans("VAT").'</td><td align="right">'.price($tva_solde).'</td></tr>'; 226 } 227 228 229 // Charges sociales 230 $var = !$var; 231 $chs = new ChargeSociales($db); 232 233 $chs_a_payer = $chs->solde(); 234 235 $total = $total - $chs_a_payer; 236 237 print "<tr ".$bc[$var].">".'<td colspan="5">'.$langs->trans("SocialContributions").'</td><td align="right">'.price($chs_a_payer).'</td></tr>'; 238 239 // Total 240 print '<tr class="liste_total"><td colspan="4"> </td><td align="center"><b>'.$langs->trans("Total").'</b></td><td align="right"><b>'.price($total).'</b></td></tr>'; 241 242 243 print "</table>"; 244 245 246 /* 247 * Boutons d'actions 248 */ 249 print "<br><div class=\"tabsAction\">\n"; 250 if ($user->rights->banque->configurer) { 251 print '<a class="tabAction" href="fiche.php?action=create">'.$langs->trans("NewFinancialAccount").'</a>'; 252 print '<a class="tabAction" href="categ.php">'.$langs->trans("Categories").'</a>'; 253 } 254 print "</div>"; 255 256 257 $db->close(); 258 259 llxFooter('$Date: 2005/10/15 15:32:02 $ - $Revision: 1.33 $'); 260 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |