diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b4bac9b1d73..e1c2bf662df 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -115,6 +115,11 @@ abstract class CommonObject */ public $array_languages = null; // Value is array() when load already tried + /** + * @var mixed Array of linked objects, set and used when calling ->create() to be able to create links during the creation of object + */ + public $linked_objects; + /** * @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked */ diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 74bab57c605..8d577d94ca2 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -61,6 +61,19 @@ abstract class CommonObjectLine extends CommonObject public $date_fin_prevue; public $date_fin_reel; + public $weight; + public $weight_units; + public $width; + public $width_units; + public $height; + public $height_units; + public $length; + public $length_units; + public $surface; + public $surface_units; + public $volume; + public $volume_units; + /** * Constructor diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index f41b855e123..2c43cd715a3 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -528,6 +528,8 @@ class Delivery extends CommonObject public function create_from_sending($user, $sending_id) { // phpcs:enable + global $conf; + $expedition = new Expedition($this->db); $result = $expedition->fetch($sending_id); @@ -772,9 +774,9 @@ class Delivery extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Load lines + * Load lines insto $this->lines. * - * @return void + * @return int <0 if KO, >0 if OK */ public function fetch_lines() { @@ -840,9 +842,11 @@ class Delivery extends CommonObject $i++; } $this->db->free($resql); - } - return $this->lines; + return 1; + } else { + return -1; + } } @@ -973,7 +977,7 @@ class Delivery extends CommonObject if ($resultSourceLine) { $num_lines = $this->db->num_rows($resultSourceLine); $i = 0; - $resultArray = array(); + $array = array(); while ($i < $num_lines) { $objSourceLine = $this->db->fetch_object($resultSourceLine); @@ -1133,14 +1137,6 @@ class DeliveryLine extends CommonObjectLine */ public $table_element = 'deliverydet'; - // From llx_expeditiondet - public $qty; - public $qty_asked; - public $qty_shipped; - public $price; - public $fk_product; - public $origin_id; - /** * @var string delivery note lines label */ @@ -1162,11 +1158,25 @@ class DeliveryLine extends CommonObjectLine */ public $libelle; - public $origin_line_id; + // From llx_expeditiondet + public $qty; + public $qty_asked; + public $qty_shipped; + public $fk_product; + public $product_desc; + public $product_type; public $product_ref; public $product_label; + public $fk_origin_line; + public $origin_id; + + public $price; + + public $origin_line_id; + + /** * Constructor * diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 069f39d66e3..d38f6deb2bc 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1106,14 +1106,14 @@ if ($step == 4 && $datatoimport) { if ($j == $i) { print ' selected'; } - print " data-html='".dol_escape_htmltag($label)."'"; + print ' data-html="'.dol_escape_htmltag($label).'"'; print '>'; print $label; print ''; $j++; } print ''; - //print ajax_combobox('selectorderimport_'.($i+1)); + print ajax_combobox('selectorderimport_'.($i+1)); print ""; print '