From 6f93e9cdac8b15989869a9919dca1524914b3df4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2012 20:53:49 +0200 Subject: [PATCH] Fix: Can delete even if data corrupted (fk_bank set but entry removed manually into llx_bank). --- htdocs/adherents/class/cotisation.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/cotisation.class.php b/htdocs/adherents/class/cotisation.class.php index 75d2ffe2722..f08b2257a7d 100644 --- a/htdocs/adherents/class/cotisation.class.php +++ b/htdocs/adherents/class/cotisation.class.php @@ -65,9 +65,9 @@ class Cotisation extends CommonObject function create($userid) { global $langs; - + $now=dol_now(); - + // Check parameters if ($this->datef <= $this->dateh) { @@ -218,7 +218,7 @@ class Cotisation extends CommonObject $result=$member->fetch($this->fk_adherent); $result=$member->update_end_date($user); - if ($this->fk_bank) + if ($accountline->rowid > 0) // If we found bank account line (this means this->fk_bank defined) { $result=$accountline->delete($user); // Return false if refused because line is conciliated if ($result > 0)