diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index bc4d085f8ce..5ad1c7dda24 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -424,7 +424,7 @@ if (empty($reshook)) { } // Defined the new fk_parent_line - if ($result > 0) { + if ($result > 0 && $lines[$i]->product_type == 9) { $fk_parent_line = $result; } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index dd322bd8245..c1ce6c3f7ba 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1244,7 +1244,7 @@ if (empty($reshook)) { $object->lines[] = $line; // insert new line in current object // Defined the new fk_parent_line - if ($result > 0) { + if ($result > 0 && $line->product_type == 9) { $fk_parent_line = $result; } } @@ -1765,7 +1765,7 @@ if (empty($reshook)) { } // Defined the new fk_parent_line - if ($result > 0) { + if ($result > 0 && $lines[$i]->product_type == 9) { $fk_parent_line = $result; } }