Merge branch 'FIX_MRP_fixes' of github.com:atm-adrien/dolibarr into FIX_MRP_fixes_2
This commit is contained in:
commit
7fb05e258f
@ -172,7 +172,8 @@ print '<td id="costline_'.$line->id.'" class="linecolcost nowrap right">';
|
|||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
if (!empty($line->fk_bom_child)) {
|
if (!empty($line->fk_bom_child)) {
|
||||||
echo '<span class="amount">'.price($tmpbom->total_cost * $line->qty).'</span>';
|
echo '<span class="amount">'.price($tmpbom->total_cost * $line->qty).'</span>';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
echo '<span class="amount">'.price($line->total_cost).'</span>';
|
echo '<span class="amount">'.price($line->total_cost).'</span>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -301,6 +302,16 @@ if ($resql) {
|
|||||||
$sub_bom->calculateCosts();
|
$sub_bom->calculateCosts();
|
||||||
print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom->total_cost * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
|
print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom->total_cost * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
|
||||||
$total_cost+= $sub_bom->total_cost * $sub_bom_line->qty * $line->qty;
|
$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 '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom_line->total_cost, 'MT')).'</span></td>';
|
||||||
|
$this->total_cost += $line->total_cost;
|
||||||
} elseif ($sub_bom_product->cost_price > 0) {
|
} elseif ($sub_bom_product->cost_price > 0) {
|
||||||
print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
|
print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
|
||||||
$total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty;
|
$total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user