diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 0e6ea992249..dadc49c7b75 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2426,7 +2426,7 @@ class PropaleLigne $sql.= ' info_bits, '; $sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, special_code, rang, marge_tx, marque_tx)'; $sql.= " VALUES (".$this->fk_propal.","; - $sql.= " ".$this->fk_parent_line.","; + $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; $sql.= " '".$this->db->escape($this->desc)."',"; $sql.= " ".($this->fk_product?"'".$this->fk_product."'":"null").","; $sql.= " '".$this->product_type."',"; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 24fee33b743..47444383269 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2727,7 +2727,7 @@ class OrderLine $sql.= ' special_code, rang, marge_tx, marque_tx,'; $sql.= ' info_bits, total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, date_start, date_end)'; $sql.= " VALUES (".$this->fk_commande.","; - $sql.= " ".$this->fk_parent_line.","; + $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; $sql.= " '".$this->db->escape($this->desc)."',"; $sql.= " '".price2num($this->qty)."',"; $sql.= " '".price2num($this->tva_tx)."',"; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d807642495d..da5b3f2fcb9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3256,7 +3256,7 @@ class FactureLigne $sql.= ' rang, special_code,'; $sql.= ' info_bits, total_ht, total_tva, total_localtax1, total_localtax2, total_ttc)'; $sql.= " VALUES (".$this->fk_facture.","; - $sql.= " ".$this->fk_parent_line.","; + $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; $sql.= " '".$this->db->escape($this->desc)."',"; $sql.= " ".price2num($this->qty).","; $sql.= " ".price2num($this->tva_tx).",";