Skip to content

Commit

Permalink
Merge pull request #7057 from atm-john/FIX_linked_element_facture_rec
Browse files Browse the repository at this point in the history
FIX delete linked element on facture rec
  • Loading branch information
eldy committed Jun 27, 2017
2 parents 3a6314b + 93477c1 commit ae6b097
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion htdocs/compta/facture/class/facture-rec.class.php
Expand Up @@ -475,7 +475,13 @@ function delete($user, $notrigger=0, $idwarehouse=-1)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_rec WHERE rowid = ".$rowid;
dol_syslog($sql);
if (! $this->db->query($sql))
if ($this->db->query($sql))
{
// Delete linked object
$res = $this->deleteObjectLinked();
if ($res < 0) $error=-3;
}
else
{
$this->error=$this->db->lasterror();
$error=-1;
Expand Down

0 comments on commit ae6b097

Please sign in to comment.