diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php
index a72f07c6f82..ab407485173 100644
--- a/htdocs/adherents/fiche_subscription.php
+++ b/htdocs/adherents/fiche_subscription.php
@@ -251,11 +251,6 @@ if ($rowid && $action != 'edit')
if ($msg) print '
'.$msg.'
';
- //$result=$subscription->load_previous_next_id($adh->next_prev_filter);
- //if ($result < 0) dolibarr_print_error($db,$subscription->error);
- //$previous_id = $adh->id_previous?'id_previous).'">'.img_previous().'':'';
- //$next_id = $adh->id_next?'id_next).'">'.img_next().'':'';
-
// Confirmation de la suppression de l'adhérent
if ($action == 'delete')
{
@@ -301,10 +296,10 @@ if ($rowid && $action != 'edit')
if ($subscription->fk_bank)
{
$bankline=new AccountLine($db);
- $bankline->fetch($subscription->fk_bank);
-
+ $result=$bankline->fetch($subscription->fk_bank);
+
$bank=new Account($db);
- $bank->fetch($bankline->fk_account);
+ $result=$bank->fetch($bankline->fk_account);
print '';
print '| '.$langs->trans('BankAccount').' | ';
diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php
index e168426cc59..d25b4e44730 100644
--- a/htdocs/compta/bank/account.class.php
+++ b/htdocs/compta/bank/account.class.php
@@ -780,10 +780,12 @@ class AccountLine
/**
* \brief Charge en memoire depuis la base, une ecriture sur le compte
* \param id Id de la ligne écriture à récupérer
+ * \return int <0 if KO, >0 if OK
*/
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.= " FROM ".MAIN_DB_PREFIX."bank";
$sql.= " WHERE rowid = ".$rowid;
@@ -804,6 +806,7 @@ class AccountLine
$this->dateo = $obj->dateo;
$this->amount = $obj->amount;
$this->label = $obj->label;
+ $this->fk_account = $obj->fk_account;
$this->note = $obj->note;
$this->fk_user_author = $obj->fk_user_author;
@@ -816,10 +819,12 @@ class AccountLine
$this->rappro = $obj->rappro;
}
$this->db->free($result);
+ return 1;
}
else
{
dolibarr_print_error($this->db);
+ return -1;
}
}