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.
This commit is contained in:
parent
8e06d496bc
commit
bc952e557b
@ -34,6 +34,8 @@ class Account
|
|||||||
var $cle_rib;
|
var $cle_rib;
|
||||||
var $bic;
|
var $bic;
|
||||||
var $iban_prefix;
|
var $iban_prefix;
|
||||||
|
var $proprio;
|
||||||
|
var $adresse_proprio;
|
||||||
|
|
||||||
Function Account($DB, $rowid=0)
|
Function Account($DB, $rowid=0)
|
||||||
{
|
{
|
||||||
@ -213,10 +215,12 @@ class Account
|
|||||||
$sql .= ",number='".$this->number."'";
|
$sql .= ",number='".$this->number."'";
|
||||||
$sql .= ",cle_rib='".$this->cle_rib."'";
|
$sql .= ",cle_rib='".$this->cle_rib."'";
|
||||||
$sql .= ",bic='".$this->bic."'";
|
$sql .= ",bic='".$this->bic."'";
|
||||||
|
$sql .= ",iban_prefix = '".$this->iban_prefix."'";
|
||||||
$sql .= ",domiciliation='".$this->domiciliation."'";
|
$sql .= ",domiciliation='".$this->domiciliation."'";
|
||||||
|
$sql .= ",proprio = '".$this->proprio."'";
|
||||||
|
$sql .= ",adresse_proprio = '".$this->adresse_proprio."'";
|
||||||
$sql .= ",courant = ".$this->courant;
|
$sql .= ",courant = ".$this->courant;
|
||||||
$sql .= ",clos = ".$this->clos;
|
$sql .= ",clos = ".$this->clos;
|
||||||
$sql .= ",iban_prefix = '".$this->iban_prefix."'";
|
|
||||||
|
|
||||||
$sql .= " WHERE rowid = $this->id";
|
$sql .= " WHERE rowid = $this->id";
|
||||||
|
|
||||||
@ -243,7 +247,7 @@ class Account
|
|||||||
Function fetch($id)
|
Function fetch($id)
|
||||||
{
|
{
|
||||||
$this->id = $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;
|
$sql .= " WHERE rowid = ".$id;
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -263,8 +267,10 @@ class Account
|
|||||||
$this->number = $obj->number;
|
$this->number = $obj->number;
|
||||||
$this->cle_rib = $obj->cle_rib;
|
$this->cle_rib = $obj->cle_rib;
|
||||||
$this->bic = $obj->bic;
|
$this->bic = $obj->bic;
|
||||||
$this->domiciliation = $obj->domiciliation;
|
|
||||||
$this->iban_prefix = $obj->iban_prefix;
|
$this->iban_prefix = $obj->iban_prefix;
|
||||||
|
$this->domiciliation = $obj->domiciliation;
|
||||||
|
$this->proprio = $obj->proprio;
|
||||||
|
$this->adresse_proprio = $obj->adresse_proprio;
|
||||||
}
|
}
|
||||||
$this->db->free();
|
$this->db->free();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,8 +34,10 @@ if ($HTTP_POST_VARS["action"] == 'add')
|
|||||||
|
|
||||||
$account->bank = $HTTP_POST_VARS["bank"];
|
$account->bank = $HTTP_POST_VARS["bank"];
|
||||||
$account->label = $HTTP_POST_VARS["label"];
|
$account->label = $HTTP_POST_VARS["label"];
|
||||||
|
|
||||||
$account->courant = $HTTP_POST_VARS["courant"];
|
$account->courant = $HTTP_POST_VARS["courant"];
|
||||||
$account->clos = $HTTP_POST_VARS["clos"];
|
$account->clos = $HTTP_POST_VARS["clos"];
|
||||||
|
|
||||||
$account->code_banque = $HTTP_POST_VARS["code_banque"];
|
$account->code_banque = $HTTP_POST_VARS["code_banque"];
|
||||||
$account->code_guichet = $HTTP_POST_VARS["code_guichet"];
|
$account->code_guichet = $HTTP_POST_VARS["code_guichet"];
|
||||||
$account->number = $HTTP_POST_VARS["number"];
|
$account->number = $HTTP_POST_VARS["number"];
|
||||||
@ -43,6 +45,10 @@ if ($HTTP_POST_VARS["action"] == 'add')
|
|||||||
$account->bic = $HTTP_POST_VARS["bic"];
|
$account->bic = $HTTP_POST_VARS["bic"];
|
||||||
$account->iban_prefix = $HTTP_POST_VARS["iban_prefix"];
|
$account->iban_prefix = $HTTP_POST_VARS["iban_prefix"];
|
||||||
$account->domiciliation = $HTTP_POST_VARS["domiciliation"];
|
$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->solde = $HTTP_POST_VARS["solde"];
|
||||||
$account->date_solde = mktime(12,0,0,$HTTP_POST_VARS["remonth"],$HTTP_POST_VARS["reday"],$HTTP_POST_VARS["reyear"]);
|
$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->bic = $HTTP_POST_VARS["bic"];
|
||||||
$account->iban_prefix = $HTTP_POST_VARS["iban_prefix"];
|
$account->iban_prefix = $HTTP_POST_VARS["iban_prefix"];
|
||||||
$account->domiciliation = $HTTP_POST_VARS["domiciliation"];
|
$account->domiciliation = $HTTP_POST_VARS["domiciliation"];
|
||||||
|
|
||||||
|
$account->proprio = $HTTP_POST_VARS["proprio"];
|
||||||
|
$account->adresse_proprio = $HTTP_POST_VARS["adresse_proprio"];
|
||||||
|
|
||||||
$account->update($id, $user);
|
$account->update($id, $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +92,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
print_titre("Nouveau compte bancaire");
|
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="action" value="add">';
|
||||||
print '<input type="hidden" name="clos" value="0">';
|
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 '<option value="0">non<option value="1">oui</select></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">Domiciliation</td><td colspan="3">';
|
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 $user->description;
|
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 "</textarea></td></tr>";
|
||||||
|
|
||||||
print '<tr><td valign="top">Solde</td>';
|
print '<tr><td valign="top">Solde</td>';
|
||||||
@ -136,7 +152,7 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($id)
|
if ($id && $action != 'edit')
|
||||||
{
|
{
|
||||||
$account = new Account($db, $id);
|
$account = new Account($db, $id);
|
||||||
$account->fetch($id);
|
$account->fetch($id);
|
||||||
@ -178,6 +194,14 @@ else
|
|||||||
print $account->domiciliation;
|
print $account->domiciliation;
|
||||||
print "</td></tr>\n";
|
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 '</table>';
|
||||||
|
|
||||||
print '<br><table width="100%" border="1" cellspacing="0" cellpadding="2">';
|
print '<br><table width="100%" border="1" cellspacing="0" cellpadding="2">';
|
||||||
@ -197,18 +221,25 @@ else
|
|||||||
|
|
||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
|
|
||||||
/* ************************************************************************** */
|
}
|
||||||
/* */
|
|
||||||
/* Edition */
|
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
|
|
||||||
if ($action == 'edit' && $user->admin)
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* Edition */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
if ($id && $action == 'edit' && $user->admin)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$account = new Account($db, $id);
|
||||||
|
$account->fetch($id);
|
||||||
|
|
||||||
$form = new Form($db);
|
$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 '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
print '<table border="1" cellpadding="3" cellspacing="0">';
|
print '<table border="1" cellpadding="3" cellspacing="0">';
|
||||||
@ -247,17 +278,24 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">Domiciliation</td><td colspan="3">';
|
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 $account->domiciliation;
|
||||||
print "</textarea></td></tr>";
|
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 '<tr><td align="center" colspan="4"><input value="Enregistrer" type="submit"></td></tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -145,7 +145,7 @@ print '<a href="fiche.php?action=create">Nouveau compte</a></td>';
|
|||||||
* Case 2
|
* 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%">-</td>';
|
||||||
print '<td align="center" width="20%">';
|
print '<td align="center" width="20%">';
|
||||||
print '<a href="categ.php">Catégories</a></td>';
|
print '<a href="categ.php">Catégories</a></td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user