Browse Source

Fix var not always defined

Laurent Destailleur 9 years ago
parent
commit
8e9a7cb629
1 changed files with 3 additions and 2 deletions
  1. 3 2
      htdocs/adherents/class/cotisation.class.php

+ 3 - 2
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);
 		}