diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php
index 60736d085da..f6644590a2e 100644
--- a/htdocs/bom/bom_net_needs.php
+++ b/htdocs/bom/bom_net_needs.php
@@ -218,6 +218,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '
'.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).' | ';
print ''.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).' | ';
print '';
+
+ print '';
+ print '';
if (!empty($TChildBom)) {
if ($action == 'treeview') {
foreach ($TChildBom as $fk_bom => $TProduct) {
@@ -266,7 +269,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
}
- print '';
+ print '';
print '';
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index ac277f6e880..95bbed79784 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -301,6 +301,16 @@ if ($resql) {
$sub_bom->calculateCosts();
print ''.price(price2num($sub_bom->total_cost * $sub_bom_line->qty * $line->qty, 'MT')).' | ';
$total_cost+= $sub_bom->total_cost * $sub_bom_line->qty * $line->qty;
+ } elseif ($sub_bom_product->type == Product::TYPE_SERVICE && isModEnabled('workstation') && !empty($sub_bom_product->fk_default_workstation)) {
+ //Convert qty to hour
+ $unit = measuringUnitString($sub_bom_line->fk_unit, '', '', 1);
+ $qty = convertDurationtoHour($sub_bom_line->qty, $unit);
+ $workstation = new Workstation($this->db);
+ $res = $workstation->fetch($sub_bom_product->fk_default_workstation);
+ if ($res > 0) $sub_bom_line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
+
+ print ''.price(price2num($sub_bom_line->total_cost, 'MT')).' | ';
+ $this->total_cost += $line->total_cost;
} elseif ($sub_bom_product->cost_price > 0) {
print ''.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).' | ';
$total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty;