This commit is contained in:
atm-lena 2022-07-06 16:51:50 +02:00
parent dadff083a4
commit 503e2310ea
4 changed files with 20 additions and 6 deletions

View File

@ -1140,15 +1140,23 @@ class BOM extends CommonObject
}
}
} 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($tmpproduct->fk_default_workstation) {
$workstation = new Workstation($this->db);
$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 {
$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;

View File

@ -141,7 +141,7 @@ if($filtertype != 1) {
$coldisplay++;
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>';
$coldisplay++;

View File

@ -57,7 +57,7 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
// Product or sub-bom
print '<td class="linecoldescription">'.$langs->trans('Description');
if (!empty($conf->global->BOM_SUB_BOM)) {
if (!empty($conf->global->BOM_SUB_BOM) && $filtertype != 1) {
print ' &nbsp; <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;';
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
}
@ -80,15 +80,20 @@ if($filtertype != 1) {
// Efficiency
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 {
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>';
// 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

View File

@ -82,6 +82,7 @@ ProductsToProduce=Produits à produire
UnitCost=Coût unitaire
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)
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
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.