diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 1c2fe54cc71..2c507e3e59d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2010-2011 Philippe Grand - * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -788,6 +788,9 @@ class Propal extends CommonObject $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, $this->lines[$i]->label + $this->lines[$i]->date_start, + $this->lines[$i]->date_end, + $this->lines[$i]->array_options ); if ($result < 0) @@ -922,6 +925,10 @@ class Propal extends CommonObject $this->db->begin(); + // get extrafields so they will be clone + foreach($this->lines as $line) + $line->fetch_optionals($line->rowid); + // Load source object $objFrom = dol_clone($this); @@ -1046,7 +1053,7 @@ class Propal extends CommonObject $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON p.fk_input_reason = dr.rowid'; $sql.= " WHERE p.fk_statut = c.id"; $sql.= " AND p.entity = ".$conf->entity; - if ($ref) $sql.= " AND p.ref='".$this->db->escape($ref)."'"; + if ($ref) $sql.= " AND p.ref='".$ref."'"; else $sql.= " AND p.rowid=".$rowid; dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 795c2e26526..7a8fd63c8f1 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011 Jean Heimburger - * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -712,7 +712,8 @@ class Commande extends CommonOrder $fk_parent_line, $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, - $this->lines[$i]->label + $this->lines[$i]->label, + $this->lines[$i]->array_options ); if ($result < 0) { @@ -850,6 +851,10 @@ class Commande extends CommonOrder $this->db->begin(); + // get extrafields so they will be clone + foreach($this->lines as $line) + $line->fetch_optionals($line->rowid); + // Load source object $objFrom = dol_clone($this); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e9bf109b9e7..93e245746a0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2012 Marcos GarcĂ­a * Copyright (C) 2013 Cedric Gross * Copyright (C) 2013 Florian Henry @@ -367,7 +367,8 @@ class Facture extends CommonInvoice $fk_parent_line, $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, - $this->lines[$i]->label + $this->lines[$i]->label, + $this->lines[$i]->array_options ); if ($result < 0) { @@ -569,6 +570,10 @@ class Facture extends CommonInvoice $this->db->begin(); + // get extrafields so they will be clone + foreach($this->lines as $line) + $line->fetch_optionals($line->rowid); + // Load source object $objFrom = dol_clone($this);