Skip to content
Snippets Groups Projects
Commit bc952e55 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

La taille des champs entre bank (libellé) et domiciliation (adresse postale)...

La taille des champs entre bank (libellé) et domiciliation (adresse postale) étaient inversées, l'adresse du RIB était du coup tronquée.
Ajout du nom du propriétaire du compte et de l'adresse du propriétaire du compte.
parent 8e06d496
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,8 @@ class Account
var $cle_rib;
var $bic;
var $iban_prefix;
var $proprio;
var $adresse_proprio;
Function Account($DB, $rowid=0)
{
......@@ -213,10 +215,12 @@ class Account
$sql .= ",number='".$this->number."'";
$sql .= ",cle_rib='".$this->cle_rib."'";
$sql .= ",bic='".$this->bic."'";
$sql .= ",iban_prefix = '".$this->iban_prefix."'";
$sql .= ",domiciliation='".$this->domiciliation."'";
$sql .= ",proprio = '".$this->proprio."'";
$sql .= ",adresse_proprio = '".$this->adresse_proprio."'";
$sql .= ",courant = ".$this->courant;
$sql .= ",clos = ".$this->clos;
$sql .= ",iban_prefix = '".$this->iban_prefix."'";
$sql .= " WHERE rowid = $this->id";
......@@ -243,7 +247,7 @@ class Account
Function fetch($id)
{
$this->id = $id;
$sql = "SELECT rowid, label, bank, number, courant, clos, code_banque,code_guichet,cle_rib,bic,iban_prefix,domiciliation FROM ".MAIN_DB_PREFIX."bank_account";
$sql = "SELECT rowid, label, bank, number, courant, clos, code_banque, code_guichet, cle_rib, bic, iban_prefix, domiciliation, proprio, adresse_proprio FROM ".MAIN_DB_PREFIX."bank_account";
$sql .= " WHERE rowid = ".$id;
$result = $this->db->query($sql);
......@@ -263,8 +267,10 @@ class Account
$this->number = $obj->number;
$this->cle_rib = $obj->cle_rib;
$this->bic = $obj->bic;
$this->domiciliation = $obj->domiciliation;
$this->iban_prefix = $obj->iban_prefix;
$this->domiciliation = $obj->domiciliation;
$this->proprio = $obj->proprio;
$this->adresse_proprio = $obj->adresse_proprio;
}
$this->db->free();
}
......
......@@ -34,8 +34,10 @@ if ($HTTP_POST_VARS["action"] == 'add')
$account->bank = $HTTP_POST_VARS["bank"];
$account->label = $HTTP_POST_VARS["label"];
$account->courant = $HTTP_POST_VARS["courant"];
$account->clos = $HTTP_POST_VARS["clos"];
$account->code_banque = $HTTP_POST_VARS["code_banque"];
$account->code_guichet = $HTTP_POST_VARS["code_guichet"];
$account->number = $HTTP_POST_VARS["number"];
......@@ -43,6 +45,10 @@ if ($HTTP_POST_VARS["action"] == 'add')
$account->bic = $HTTP_POST_VARS["bic"];
$account->iban_prefix = $HTTP_POST_VARS["iban_prefix"];
$account->domiciliation = $HTTP_POST_VARS["domiciliation"];
$account->proprio = $HTTP_POST_VARS["proprio"];
$account->adresse_proprio = $HTTP_POST_VARS["adresse_proprio"];
$account->solde = $HTTP_POST_VARS["solde"];
$account->date_solde = mktime(12,0,0,$HTTP_POST_VARS["remonth"],$HTTP_POST_VARS["reday"],$HTTP_POST_VARS["reyear"]);
......@@ -67,6 +73,10 @@ if ($action == 'update')
$account->bic = $HTTP_POST_VARS["bic"];
$account->iban_prefix = $HTTP_POST_VARS["iban_prefix"];
$account->domiciliation = $HTTP_POST_VARS["domiciliation"];
$account->proprio = $HTTP_POST_VARS["proprio"];
$account->adresse_proprio = $HTTP_POST_VARS["adresse_proprio"];
$account->update($id, $user);
}
......@@ -82,7 +92,7 @@ if ($action == 'create')
{
print_titre("Nouveau compte bancaire");
print '<p><form action="'.$PHP_SELF.'" method="post">';
print '<form action="'.$PHP_SELF.'" method="post">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="clos" value="0">';
......@@ -111,8 +121,14 @@ if ($action == 'create')
print '<option value="0">non<option value="1">oui</select></td></tr>';
print '<tr><td valign="top">Domiciliation</td><td colspan="3">';
print "<textarea name=\"domiciliation\" rows=\"5\" cols=\"40\">";
// print $user->description;
print "<textarea name=\"domiciliation\" rows=\"4\" cols=\"40\">";
print "</textarea></td></tr>";
print '<tr><td valign="top">Nom propriétaire du compte</td>';
print '<td colspan="3"><input size="12" type="text" name="proprio" value=""></td></tr>';
print '<tr><td valign="top">Adresse propriétaire du compte</td><td colspan="3">';
print "<textarea name=\"adresse_proprio\" rows=\"4\" cols=\"40\">";
print "</textarea></td></tr>";
print '<tr><td valign="top">Solde</td>';
......@@ -136,7 +152,7 @@ if ($action == 'create')
/* ************************************************************************** */
else
{
if ($id)
if ($id && $action != 'edit')
{
$account = new Account($db, $id);
$account->fetch($id);
......@@ -178,6 +194,14 @@ else
print $account->domiciliation;
print "</td></tr>\n";
print '<tr><td valign="top">Nom propriétaire du compte</td><td colspan="3">';
print $account->proprio;
print "</td></tr>\n";
print '<tr><td valign="top">Adresse propriétaire du compte</td><td colspan="3">';
print $account->adresse_proprio;
print "</td></tr>\n";
print '</table>';
print '<br><table width="100%" border="1" cellspacing="0" cellpadding="2">';
......@@ -197,18 +221,25 @@ else
print '</table><br>';
/* ************************************************************************** */
/* */
/* Edition */
/* */
/* ************************************************************************** */
}
/* ************************************************************************** */
/* */
/* Edition */
/* */
/* ************************************************************************** */
if ($action == 'edit' && $user->admin)
if ($id && $action == 'edit' && $user->admin)
{
$account = new Account($db, $id);
$account->fetch($id);
$form = new Form($db);
print '<p><form action="'.$PHP_SELF.'?id='.$id.'" method="post">';
print '<div class="titre">Compte bancaire</div><br>';
print '<form action="'.$PHP_SELF.'?id='.$id.'" method="post">';
print '<input type="hidden" name="action" value="update">';
print '<table border="1" cellpadding="3" cellspacing="0">';
......@@ -247,17 +278,24 @@ else
print '</td></tr>';
print '<tr><td valign="top">Domiciliation</td><td colspan="3">';
print "<textarea name=\"domiciliation\" rows=\"5\" cols=\"40\">";
print "<textarea name=\"domiciliation\" rows=\"4\" cols=\"40\">";
print $account->domiciliation;
print "</textarea></td></tr>";
print '<tr><td valign="top">Nom propriétaire du compte</td>';
print '<td colspan="3"><input size="30" type="text" name="proprio" value="'.$account->proprio.'"></td></tr>';
print "</td></tr>\n";
print '<tr><td valign="top">Adresse propriétaire du compte</td><td colspan="3">';
print "<textarea name=\"adresse_proprio\" rows=\"4\" cols=\"40\">";
print $account->adresse_proprio;
print "</textarea></td></tr>";
print '<tr><td align="center" colspan="4"><input value="Enregistrer" type="submit"></td></tr>';
print '</form>';
print '</table>';
}
}
}
......
......@@ -145,7 +145,7 @@ print '<a href="fiche.php?action=create">Nouveau compte</a></td>';
* Case 2
*/
print '<td align="center" width="20%">-</td>';
print '<td align="center" width="20%"><a href="config.php">Configurer</a></td>';
print '<td align="center" width="20%">-</td>';
print '<td align="center" width="20%">';
print '<a href="categ.php">Catgories</a></td>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment