diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index bfce6bab9a8..c459ea7b84a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1265,7 +1265,7 @@ class Propal extends CommonObject break; } // Defined the new fk_parent_line - if ($result > 0) { + if ($result > 0 && $line->product_type == 9) { $fk_parent_line = $result; } } 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/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 0b7da7a5dbc..c2c4eada0b2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1073,7 +1073,7 @@ class Commande extends CommonOrder return -1; } // Defined the new fk_parent_line - if ($result > 0) { + if ($result > 0 && $line->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; } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 5379de84bef..bdf1192f1a5 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -872,7 +872,7 @@ class Facture extends CommonInvoice ); // Defined the new fk_parent_line - if ($result > 0) { + if ($result > 0 && $newinvoiceline->product_type == 9) { $fk_parent_line = $result; } }