From fd1e917edc212bb1d1e82177c20405af0dbc3a2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Mar 2019 18:14:46 +0100 Subject: [PATCH] Implement fetchLines in BOM --- htdocs/bom/class/bom.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index ec695e05637..97e858ed430 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -289,6 +289,24 @@ class BOM extends CommonObject $this->lines=array(); // Load lines with object BOMLine + $sql = 'SELECT rowid, fk_product, description, qty, rank WHERE fk_bom = '.$this->id; + + $resql=$this->db->query($sql); + if ($resql) + { + $obj = $this->db->fetch_object($resql); + if ($obj) + { + $newline = new BOMLine($this->db); + $newline->id = $obj->rowid; + $newline->fk_product = $obj->fk_product; + $newline->description = $obj->description; + $newline->qty = $obj->qty; + $newline->rank = $obj->rank; + + $this->lines[] = $newline; + } + } return count($this->lines)?1:0; }