diff --git a/htdocs/adherents/class/cotisation.class.php b/htdocs/adherents/class/cotisation.class.php index 786ba79c7f3..9fe26727c25 100644 --- a/htdocs/adherents/class/cotisation.class.php +++ b/htdocs/adherents/class/cotisation.class.php @@ -190,11 +190,12 @@ class Cotisation extends CommonObject */ function delete($user) { + $accountline=new AccountLine($this->db); + // It subscription is linked to a bank transaction, we get it - if ($this->fk_bank) + if ($this->fk_bank > 0) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - $accountline=new AccountLine($this->db); $result=$accountline->fetch($this->fk_bank); }