From 3a95beac66e149947b209d0c4dc06da83aaf01c1 Mon Sep 17 00:00:00 2001 From: oscim Date: Tue, 31 Mar 2020 09:20:48 +0200 Subject: [PATCH 1/3] Update livraison.class.php add in fetch_lines method item for determine weight and dimension , and unit for all lines --- htdocs/livraison/class/livraison.class.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 88a7a7372ad..3f0c591e706 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -775,8 +775,9 @@ class Livraison extends CommonObject $this->lines = array(); $sql = "SELECT ld.rowid, ld.fk_product, ld.description, ld.subprice, ld.total_ht, ld.qty as qty_shipped, ld.fk_origin_line, "; - $sql.= " cd.qty as qty_asked, cd.label as custom_label,"; - $sql.= " p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc"; + $sql.= " cd.qty as qty_asked, cd.label as custom_label, cd.fk_unit ,"; + $sql.= " p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc,"; + $sql.= " p.weight, p.weight_units, p.width, p.width_units, p.length, p.length_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch"; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."livraisondet as ld"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on p.rowid = ld.fk_product"; $sql.= " WHERE ld.fk_origin_line = cd.rowid"; @@ -812,6 +813,23 @@ class Livraison extends CommonObject $line->price = $obj->price; $line->total_ht = $obj->total_ht; + // Add + $line->weight = $obj->weight; + $line->weight_units = $obj->weight_units; + $line->width = $obj->width; + $line->width_units = $obj->width_units; + $line->height = $obj->height; + $line->height_units = $obj->height_units; + $line->length = $obj->length; + $line->length_units = $obj->length_units; + $line->surface = $obj->surface; + $line->surface_units = $obj->surface_units; + $line->volume = $obj->volume; + $line->volume_units = $obj->volume_units; + + + $line->fk_unit = $obj->fk_unit; + $this->lines[$i] = $line; $i++; From fb80199713bf1045b98e2b8096d4df47626a9b34 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 31 Mar 2020 07:23:36 +0000 Subject: [PATCH 2/3] Fixing style errors. --- htdocs/livraison/class/livraison.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 3f0c591e706..e96a9d36035 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -813,7 +813,7 @@ class Livraison extends CommonObject $line->price = $obj->price; $line->total_ht = $obj->total_ht; - // Add + // Add $line->weight = $obj->weight; $line->weight_units = $obj->weight_units; $line->width = $obj->width; @@ -826,10 +826,10 @@ class Livraison extends CommonObject $line->surface_units = $obj->surface_units; $line->volume = $obj->volume; $line->volume_units = $obj->volume_units; - - + + $line->fk_unit = $obj->fk_unit; - + $this->lines[$i] = $line; $i++; From a2fd363f91f3846b9dbe5130b0e8c6f70a7e483c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 2 Apr 2020 12:55:06 +0200 Subject: [PATCH 3/3] Update livraison.class.php --- htdocs/livraison/class/livraison.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index e96a9d36035..da1fc75b5b2 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -775,7 +775,7 @@ class Livraison extends CommonObject $this->lines = array(); $sql = "SELECT ld.rowid, ld.fk_product, ld.description, ld.subprice, ld.total_ht, ld.qty as qty_shipped, ld.fk_origin_line, "; - $sql.= " cd.qty as qty_asked, cd.label as custom_label, cd.fk_unit ,"; + $sql.= " cd.qty as qty_asked, cd.label as custom_label, cd.fk_unit,"; $sql.= " p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc,"; $sql.= " p.weight, p.weight_units, p.width, p.width_units, p.length, p.length_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch"; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."livraisondet as ld"; @@ -813,7 +813,7 @@ class Livraison extends CommonObject $line->price = $obj->price; $line->total_ht = $obj->total_ht; - // Add + // units $line->weight = $obj->weight; $line->weight_units = $obj->weight_units; $line->width = $obj->width; @@ -827,7 +827,6 @@ class Livraison extends CommonObject $line->volume = $obj->volume; $line->volume_units = $obj->volume_units; - $line->fk_unit = $obj->fk_unit; $this->lines[$i] = $line;