From ace11dbf98387c1d30d21c6969c15db30942b6e5 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 20 Feb 2023 11:47:42 +0100 Subject: [PATCH 1/3] FIX : Update bom net needs table --- htdocs/bom/bom_net_needs.php | 8 +++++++- htdocs/langs/en_US/mrp.lang | 1 + htdocs/langs/fr_FR/mrp.lang | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index f6644590a2e..f320798bf93 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -214,6 +214,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' '; } print ''; + if($action == 'treeview') print ''.$langs->trans('ProducedBy').''; print ''.$langs->trans('Quantity').''; print ''.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).''; print ''.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).''; @@ -226,13 +227,17 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea foreach ($TChildBom as $fk_bom => $TProduct) { $repeatChar = ' '; if (!empty($TProduct['bom'])) { + $prod = new Product($db); + $prod->fetch($TProduct['bom']->fk_product); if ($TProduct['parentid'] != $object->id) print ''; else print ''; - print ''.str_repeat($repeatChar, $TProduct['level']).$TProduct['bom']->getNomUrl(1); + if($action == 'treeview') print ''.str_repeat($repeatChar, $TProduct['level']).$prod->getNomUrl(1); + else print ''.str_repeat($repeatChar, $TProduct['level']).$TProduct['bom']->getNomUrl(1); print ' '; print img_picto('', 'folder-open'); print ''; print ''; + if($action == 'treeview') print ''.$TProduct['bom']->getNomUrl(1).''; print ''.$TProduct['qty'].''; print ''; print ''; @@ -247,6 +252,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($fk_bom != $object->id) print ''; else print ''; print ''.str_repeat($repeatChar, $TInfos['level']).$prod->getNomUrl(1).''; + if($action == 'treeview') print ''; print ''.$TInfos['qty'].''; print ''.price2num($prod->stock_reel, 'MS').''; print ''.$prod->stock_theorique.''; diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 6bdea0cc951..fffb9e571da 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -118,3 +118,4 @@ BomCantAddChildBom=The nomenclature %s is already present in the tree leading to BOMNetNeeds = BOM Net Needs BOMProductsList=BOM's products BOMServicesList=BOM's services +ProducedBy=Produced by \ No newline at end of file diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index 26942e14743..ff105886987 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -119,3 +119,4 @@ BomCantAddChildBom=La nomenclature %s est déjà présente dans l'arbre menant BOMNetNeeds = Besoins nets BOMProductsList=Les produits de BOM BOMServicesList=Les services de BOM +ProducedBy=Produit par \ No newline at end of file From 98f24362ecfe682551a186cfd5b5773a73d48ff1 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 20 Feb 2023 15:00:11 +0100 Subject: [PATCH 2/3] FIX : folder problem when showing/hiding bom sub lines on the bom_net_needs page --- htdocs/bom/bom_net_needs.php | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index f320798bf93..32cb02db295 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -296,20 +296,30 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea