From dfd18ef9f74cda6d5079d2a2b573c1a480bdb279 Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Sat, 28 Sep 2024 12:22:30 +0200 Subject: [PATCH] FIX : Wrong price for BOM with warkstation (#31142) * FIX : Wrong price for BOM with warkstation * FIX : PR returns --- htdocs/bom/tpl/objectline_view.tpl.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index b03d488e1b0..1bf02f13cad 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -184,6 +184,12 @@ if ($filtertype != 1) { print ''; $coldisplay++; if ($res > 0) { + $unit = new CUnits($object->db); + $fk_defaultUnit = $unit->getUnitFromCode('h', 'short_label', 'time'); + $nbPlannedHour = $unit->unitConverter($line->qty, $line->fk_unit, $fk_defaultUnit); + $line->total_cost = 0; + if ($workstation->thm_machine_estimated) $line->total_cost += $nbPlannedHour * $workstation->thm_machine_estimated; + if ($workstation->thm_operator_estimated) $line->total_cost += $nbPlannedHour * $workstation->thm_operator_estimated; echo $workstation->getNomUrl(1); } print ''; @@ -192,6 +198,7 @@ if ($filtertype != 1) { // Cost $total_cost = 0; + $tmpbom->calculateCosts(); print ''; $coldisplay++;