Skip to content

Commit

Permalink
FIX deletion of bank tag
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 27, 2017
1 parent 1083898 commit 1be389f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion htdocs/compta/bank/class/bankcateg.class.php
Expand Up @@ -202,7 +202,6 @@ public function delete(User $user, $notrigger = 0)
// Delete link between tag and bank account
if (! $error)
{
//$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class"; // No more used
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account";
$sql.= " WHERE fk_categorie = ".$this->id;

Expand All @@ -214,6 +213,20 @@ public function delete(User $user, $notrigger = 0)
}
}

// Delete link between tag and bank lines
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class"; // No more used
$sql.= " WHERE fk_categ = ".$this->id;

$resql = $this->db->query($sql);
if (!$resql)
{
$error++;
$this->errors[] = "Error ".$this->db->lasterror();
}
}

// Delete bank categ
if (! $error)
{
Expand Down

0 comments on commit 1be389f

Please sign in to comment.