WIP
This commit is contained in:
parent
dadff083a4
commit
503e2310ea
@ -1140,15 +1140,23 @@ class BOM extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
if($line->duration_unit == 's') $qty = $line->qty / 3600;
|
||||||
|
if($line->duration_unit == 'i') $qty = $line->qty / 60;
|
||||||
|
if($line->duration_unit == 'd') $qty = $line->qty * 24;
|
||||||
|
if($line->duration_unit == 'w') $qty = $line->qty * 24 * 7;
|
||||||
|
if($line->duration_unit == 'm') $qty = $line->qty * 730.484;
|
||||||
|
if($line->duration_unit == 'y') $qty = $line->qty * 365 * 24;
|
||||||
|
|
||||||
if($conf->workstation->enabled){
|
if($conf->workstation->enabled){
|
||||||
if($tmpproduct->fk_default_workstation) {
|
if($tmpproduct->fk_default_workstation) {
|
||||||
$workstation = new Workstation($this->db);
|
$workstation = new Workstation($this->db);
|
||||||
$workstation->fetch($tmpproduct->fk_default_workstation);
|
$workstation->fetch($tmpproduct->fk_default_workstation);
|
||||||
|
|
||||||
$line->total_cost = price2num($line->qty * $workstation->thm_operator_estimated, 'MT');
|
$line->total_cost = price2num($qty * $workstation->thm_operator_estimated, 'MT');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$line->total_cost = price2num($line->qty * $tmpproduct->cost_price, 'MT');
|
$line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->total_cost += $line->total_cost;
|
$this->total_cost += $line->total_cost;
|
||||||
|
|||||||
@ -141,7 +141,7 @@ if($filtertype != 1) {
|
|||||||
|
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
print '<td class="nobottom nowrap linecolunit right">';
|
print '<td class="nobottom nowrap linecolunit right">';
|
||||||
print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_value') ? GETPOST('duration_value', 'alpha') : 'h'), 0, 1);
|
print $formproduct->selectMeasuringUnits("duration_unit", "time", ($line->duration_unit) ? $line->duration_unit : '', 0, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
|
|||||||
@ -57,7 +57,7 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
|||||||
|
|
||||||
// Product or sub-bom
|
// Product or sub-bom
|
||||||
print '<td class="linecoldescription">'.$langs->trans('Description');
|
print '<td class="linecoldescription">'.$langs->trans('Description');
|
||||||
if (!empty($conf->global->BOM_SUB_BOM)) {
|
if (!empty($conf->global->BOM_SUB_BOM) && $filtertype != 1) {
|
||||||
print ' <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a> ';
|
print ' <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a> ';
|
||||||
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a> ';
|
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a> ';
|
||||||
}
|
}
|
||||||
@ -80,15 +80,20 @@ if($filtertype != 1) {
|
|||||||
// Efficiency
|
// Efficiency
|
||||||
print '<td class="linecolefficiency right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>';
|
print '<td class="linecolefficiency right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>';
|
||||||
|
|
||||||
|
// Cost
|
||||||
|
print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td>';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>';
|
print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>';
|
||||||
|
|
||||||
if($conf->workstation->enabled) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>';
|
if($conf->workstation->enabled) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>';
|
||||||
|
|
||||||
|
// Cost
|
||||||
|
print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cost
|
|
||||||
print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td>';
|
|
||||||
|
|
||||||
|
|
||||||
print '<td class="linecoledit"></td>'; // No width to allow autodim
|
print '<td class="linecoledit"></td>'; // No width to allow autodim
|
||||||
|
|||||||
@ -82,6 +82,7 @@ ProductsToProduce=Produits à produire
|
|||||||
UnitCost=Coût unitaire
|
UnitCost=Coût unitaire
|
||||||
TotalCost=Coût total
|
TotalCost=Coût total
|
||||||
BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat)
|
BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat)
|
||||||
|
BOMTotalService=Si le module "Poste de travail" est activé, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service"
|
||||||
BOMProductsList=Liste des composants
|
BOMProductsList=Liste des composants
|
||||||
BOMServicesList=Liste des services
|
BOMServicesList=Liste des services
|
||||||
GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler.
|
GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user