diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 3522d8b6c9d..da8b110abd2 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1376,7 +1376,7 @@ if ($resql) // Debit if (! empty($arrayfields['b.debit']['checked'])) { - print ''; + print ''; if ($objp->amount < 0) { print price($objp->amount * -1); @@ -1390,7 +1390,7 @@ if ($resql) // Credit if (! empty($arrayfields['b.credit']['checked'])) { - print ''; + print ''; if ($objp->amount > 0) { print price($objp->amount); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 26102b9b42a..15133af88d7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7624,18 +7624,20 @@ abstract class CommonObject } // Delete cascade first - foreach($this->childtablesoncascade as $table) - { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id; - $resql = $this->db->query($sql); - if (! $resql) - { - $this->error=$this->db->lasterror(); - $this->errors[]=$this->error; - $this->db->rollback(); - return -1; - } - } + if (! empty($this->childtablesoncascade)) { + foreach($this->childtablesoncascade as $table) + { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id; + $resql = $this->db->query($sql); + if (! $resql) + { + $this->error=$this->db->lasterror(); + $this->errors[]=$this->error; + $this->db->rollback(); + return -1; + } + } + } if (! $error) { if (! $notrigger) {