Fix: Mauvais libellé compte affiché

This commit is contained in:
Laurent Destailleur 2007-11-18 22:26:48 +00:00
parent 4ce1d87927
commit 8a6c3950ff
2 changed files with 9 additions and 9 deletions

View File

@ -251,11 +251,6 @@ if ($rowid && $action != 'edit')
if ($msg) print '<div class="error">'.$msg.'</div>'; if ($msg) print '<div class="error">'.$msg.'</div>';
//$result=$subscription->load_previous_next_id($adh->next_prev_filter);
//if ($result < 0) dolibarr_print_error($db,$subscription->error);
//$previous_id = $adh->id_previous?'<a href="'.$_SERVER["PHP_SELF"].'?rowid='.urlencode($adh->id_previous).'">'.img_previous().'</a>':'';
//$next_id = $adh->id_next?'<a href="'.$_SERVER["PHP_SELF"].'?rowid='.urlencode($adh->id_next).'">'.img_next().'</a>':'';
// Confirmation de la suppression de l'adhérent // Confirmation de la suppression de l'adhérent
if ($action == 'delete') if ($action == 'delete')
{ {
@ -301,10 +296,10 @@ if ($rowid && $action != 'edit')
if ($subscription->fk_bank) if ($subscription->fk_bank)
{ {
$bankline=new AccountLine($db); $bankline=new AccountLine($db);
$bankline->fetch($subscription->fk_bank); $result=$bankline->fetch($subscription->fk_bank);
$bank=new Account($db); $bank=new Account($db);
$bank->fetch($bankline->fk_account); $result=$bank->fetch($bankline->fk_account);
print '<tr>'; print '<tr>';
print '<td valign="top" width="140">'.$langs->trans('BankAccount').'</td>'; print '<td valign="top" width="140">'.$langs->trans('BankAccount').'</td>';

View File

@ -780,10 +780,12 @@ class AccountLine
/** /**
* \brief Charge en memoire depuis la base, une ecriture sur le compte * \brief Charge en memoire depuis la base, une ecriture sur le compte
* \param id Id de la ligne écriture à récupérer * \param id Id de la ligne écriture à récupérer
* \return int <0 if KO, >0 if OK
*/ */
function fetch($rowid) function fetch($rowid)
{ {
$sql = "SELECT datec, datev, dateo, amount, label, fk_user_author, fk_user_rappro,"; $sql = "SELECT datec, datev, dateo, amount, label, fk_account,";
$sql.= " fk_user_author, fk_user_rappro,";
$sql.= " fk_type, num_releve, num_chq, rappro, note"; $sql.= " fk_type, num_releve, num_chq, rappro, note";
$sql.= " FROM ".MAIN_DB_PREFIX."bank"; $sql.= " FROM ".MAIN_DB_PREFIX."bank";
$sql.= " WHERE rowid = ".$rowid; $sql.= " WHERE rowid = ".$rowid;
@ -804,6 +806,7 @@ class AccountLine
$this->dateo = $obj->dateo; $this->dateo = $obj->dateo;
$this->amount = $obj->amount; $this->amount = $obj->amount;
$this->label = $obj->label; $this->label = $obj->label;
$this->fk_account = $obj->fk_account;
$this->note = $obj->note; $this->note = $obj->note;
$this->fk_user_author = $obj->fk_user_author; $this->fk_user_author = $obj->fk_user_author;
@ -816,10 +819,12 @@ class AccountLine
$this->rappro = $obj->rappro; $this->rappro = $obj->rappro;
} }
$this->db->free($result); $this->db->free($result);
return 1;
} }
else else
{ {
dolibarr_print_error($this->db); dolibarr_print_error($this->db);
return -1;
} }
} }