FIX : Wrong price for BOM with warkstation (#31142)

* FIX : Wrong price for BOM with warkstation

* FIX : PR returns
This commit is contained in:
atm-adrien
2024-09-28 12:22:30 +02:00
committed by GitHub
parent 1ee85e5483
commit dfd18ef9f7

View File

@@ -184,6 +184,12 @@ if ($filtertype != 1) {
print '<td class="linecolworkstation nowrap">';
$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 '</td>';
@@ -192,6 +198,7 @@ if ($filtertype != 1) {
// Cost
$total_cost = 0;
$tmpbom->calculateCosts();
print '<td id="costline_'.$line->id.'" class="linecolcost nowrap right">';
$coldisplay++;