[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> 4 * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 * 20 * $Id: rib.php,v 1.9 2005/08/20 16:04:01 eldy Exp $ 21 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/societe/rib.php,v $ 22 */ 23 24 /** 25 \file htdocs/societe/rib.php 26 \ingroup societe 27 \brief Onglet rib de societe 28 \version $Revision: 1.9 $ 29 */ 30 31 require ("./pre.inc.php"); 32 require_once DOL_DOCUMENT_ROOT . "/companybankaccount.class.php"; 33 34 $langs->load("companies"); 35 $langs->load("banks"); 36 37 $user->getrights('societe'); 38 39 if ( !$user->rights->societe->creer) 40 accessforbidden(); 41 42 43 llxHeader(); 44 45 $soc = new Societe($db); 46 $soc->id = $_GET["socid"]; 47 $soc->fetch($_GET["socid"]); 48 49 if ($_POST["action"] == 'update' && ! $_POST["cancel"]) 50 { 51 // Modification 52 $account = new CompanyBankAccount($db, $soc->id); 53 54 $account->bank = $_POST["bank"]; 55 $account->label = $_POST["label"]; 56 $account->courant = $_POST["courant"]; 57 $account->clos = $_POST["clos"]; 58 $account->code_banque = $_POST["code_banque"]; 59 $account->code_guichet = $_POST["code_guichet"]; 60 $account->number = $_POST["number"]; 61 $account->cle_rib = $_POST["cle_rib"]; 62 $account->bic = $_POST["bic"]; 63 $account->iban_prefix = $_POST["iban_prefix"]; 64 $account->domiciliation = $_POST["domiciliation"]; 65 $account->proprio = $_POST["proprio"]; 66 $account->adresse_proprio = $_POST["adresse_proprio"]; 67 68 $result = $account->update($user); 69 if (! $result) 70 { 71 $message=$account->error(); 72 $_GET["action"]='edit'; // Force chargement page edition 73 } 74 else 75 { 76 $_GET["id"]=$_POST["id"]; // Force chargement page en mode visu 77 } 78 } 79 80 81 /* 82 * Affichage onglets 83 */ 84 $h = 0; 85 86 $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id; 87 $head[$h][1] = $langs->trans("Company"); 88 $h++; 89 90 $head[$h][0] = DOL_URL_ROOT .'/societe/rib.php?socid='.$soc->id; 91 $head[$h][1] = $langs->trans("BankAccount")." $account->number"; 92 $hselected=$h; 93 $h++; 94 95 $head[$h][0] = 'lien.php?socid='.$soc->id; 96 $head[$h][1] = $langs->trans("Links"); 97 $h++; 98 99 $head[$h][0] = 'commerciaux.php?socid='.$soc->id; 100 $head[$h][1] = $langs->trans("SalesRepresentative"); 101 $h++; 102 103 dolibarr_fiche_head($head, $hselected, $soc->nom); 104 105 $account = new CompanyBankAccount($db, $soc->id); 106 $account->fetch(); 107 108 109 /* ************************************************************************** */ 110 /* */ 111 /* Visu et edition */ 112 /* */ 113 /* ************************************************************************** */ 114 115 if ($_GET["socid"] && $_GET["action"] != 'edit') 116 { 117 if (!$account->verif()) 118 { 119 print '<div class="error"><b>Le contrôle de la clé indique que les informations de ce compte bancaire sont incomplètes ou incorrectes.</b></div><br>'; 120 } 121 122 print '<table class="border" width="100%">'; 123 124 print '<tr><td valign="top">'.$langs->trans("Bank").'</td>'; 125 print '<td colspan="4">'.$account->bank.'</td></tr>'; 126 127 print '<tr><td>'.$langs->trans("RIB").'</td><td align="center">Code Banque</td><td align="center">Code Guichet</td><td align="center">Numéro</td><td align="center">Clé RIB</td></tr>'; 128 print '<tr><td> </td><td align="center">'.$account->code_banque.'</td>'; 129 print '<td align="center">'.$account->code_guichet.'</td>'; 130 print '<td align="center">'.$account->number.'</td>'; 131 print '<td align="center">'.$account->cle_rib.'</td></tr>'; 132 133 print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>'; 134 print '<td colspan="4">'.$account->iban_prefix.'</td></tr>'; 135 136 print '<tr><td valign="top">'.$langs->trans("BIC").'</td>'; 137 print '<td colspan="4">'.$account->bic.'</td></tr>'; 138 139 print '<tr><td valign="top">Domiciliation</td><td colspan="4">'; 140 print $account->domiciliation; 141 print "</td></tr>\n"; 142 143 print '<tr><td valign="top">Nom propriétaire du compte</td><td colspan="4">'; 144 print $account->proprio; 145 print "</td></tr>\n"; 146 147 print '<tr><td valign="top">Adresse propriétaire du compte</td><td colspan="4">'; 148 print $account->adresse_proprio; 149 print "</td></tr>\n"; 150 151 print '</table>'; 152 153 print '</div>'; 154 155 156 157 /* 158 * Barre d'actions 159 * 160 */ 161 print '<div class="tabsAction">'; 162 163 if ($user->rights->societe->creer) 164 { 165 print '<a class="tabAction" href="rib.php?socid='.$soc->id.'&action=edit">'.$langs->trans("Edit").'</a>'; 166 } 167 168 print '</div>'; 169 170 } 171 172 /* ************************************************************************** */ 173 /* */ 174 /* Edition */ 175 /* */ 176 /* ************************************************************************** */ 177 178 if ($_GET["socid"] && $_GET["action"] == 'edit' && $user->rights->societe->creer) 179 { 180 181 $form = new Form($db); 182 183 if ($message) { print "$message<br><br>\n"; } 184 185 print '<form action="rib.php?socid='.$soc->id.'" method="post">'; 186 print '<input type="hidden" name="action" value="update">'; 187 print '<input type="hidden" name="id" value="'.$_GET["id"].'">'; 188 189 print '<table class="border" width="100%">'; 190 191 print '<tr><td valign="top">'.$langs->trans("Bank").'</td>'; 192 print '<td colspan="4"><input size="30" type="text" name="bank" value="'.$account->bank.'"></td></tr>'; 193 194 print '<tr><td>'.$langs->trans("RIB").'</td><td>Code Banque</td><td>Code Guichet</td><td>Numéro</td><td>Clé RIB</td></tr>'; 195 print '<tr><td> </td><td><input size="8" type="text" name="code_banque" value="'.$account->code_banque.'"></td>'; 196 print '<td><input size="8" type="text" name="code_guichet" value="'.$account->code_guichet.'"></td>'; 197 print '<td><input size="15" type="text" name="number" value="'.$account->number.'"></td>'; 198 print '<td><input size="3" type="text" name="cle_rib" value="'.$account->cle_rib.'"></td></tr>'; 199 200 print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>'; 201 print '<td colspan="4"><input size="5" type="text" name="iban_prefix" value="'.$account->iban_prefix.'"></td></tr>'; 202 203 print '<tr><td valign="top">'.$langs->trans("BIC").'</td>'; 204 print '<td colspan="4"><input size="12" type="text" name="bic" value="'.$account->bic.'"></td></tr>'; 205 206 print '<tr><td valign="top">Domiciliation</td><td colspan="4">'; 207 print "<textarea name=\"domiciliation\" rows=\"4\" cols=\"40\">"; 208 print $account->domiciliation; 209 print "</textarea></td></tr>"; 210 211 print '<tr><td valign="top">Nom propriétaire du compte</td>'; 212 print '<td colspan="4"><input size="30" type="text" name="proprio" value="'.$account->proprio.'"></td></tr>'; 213 print "</td></tr>\n"; 214 215 print '<tr><td valign="top">Adresse propriétaire du compte</td><td colspan="4">'; 216 print "<textarea name=\"adresse_proprio\" rows=\"4\" cols=\"40\">"; 217 print $account->adresse_proprio; 218 print "</textarea></td></tr>"; 219 220 print '<tr><td align="center" colspan="5"><input value="'.$langs->trans("Modify").'" type="submit">'; 221 print ' <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit">'; 222 print '</td></tr>'; 223 224 print '</form>'; 225 print '</table><br>'; 226 } 227 228 229 230 $db->close(); 231 232 233 llxFooter('$Date: 2005/08/20 16:04:01 $ - $Revision: 1.9 $'); 234 ?>
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 |
![]() |