Close #18584 : Code enhancement of MO
This commit is contained in:
parent
b9150c2441
commit
765f0c4d19
@ -74,6 +74,7 @@ NoStockChangeOnServices=No stock change on services
|
||||
ProductQtyToConsumeByMO=Product quantity still to consume by open MO
|
||||
ProductQtyToProduceByMO=Product quantity still to produce by open MO
|
||||
AddNewConsumeLines=Add new line to consume
|
||||
AddNewProduceLines=Add new line to produce
|
||||
ProductsToConsume=Products to consume
|
||||
ProductsToProduce=Products to produce
|
||||
UnitCost=Unit cost
|
||||
|
||||
@ -72,6 +72,7 @@ NoStockChangeOnServices=Aucune variation de stock sur les services
|
||||
ProductQtyToConsumeByMO=Quantité de produit restant à consommer par OF ouvert
|
||||
ProductQtyToProduceByMO=Quantités restant à produire avec les OF ouverts
|
||||
AddNewConsumeLines=Ajouter une nouvelle ligne à consommer
|
||||
AddNewProduceLines=Ajouter une nouvelle ligne à produire
|
||||
ProductsToConsume=Produits à consommer
|
||||
ProductsToProduce=Produits à produire
|
||||
UnitCost=Coût unitaire
|
||||
|
||||
@ -659,6 +659,12 @@ class Mo extends CommonObject
|
||||
$role = 'toconsume';
|
||||
$moline->role = 'toproduce';
|
||||
}
|
||||
} else {
|
||||
if ($this->mrptype == 1) {
|
||||
$moline->role = 'toconsume';
|
||||
} else {
|
||||
$moline->role = 'toproduce';
|
||||
}
|
||||
}
|
||||
|
||||
$resultline = $moline->create($user, false); // Never use triggers here
|
||||
|
||||
@ -973,15 +973,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$nblinetoproduce++;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($nblinetoproduce)) {
|
||||
if ($object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall') {
|
||||
$newlinetext = '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addproduceline">'.$langs->trans("AddNewProduceLines").'</a>';
|
||||
}
|
||||
print load_fiche_titre($langs->trans('Production'), '', '', 0, '', '', $newlinetext);
|
||||
} else {
|
||||
print load_fiche_titre($langs->trans('Production'), '', '', 0);
|
||||
$newlinetext = '';
|
||||
if ($object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall') {
|
||||
$newlinetext = '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addproduceline">'.$langs->trans("AddNewProduceLines").'</a>';
|
||||
}
|
||||
print load_fiche_titre($langs->trans('Production'), '', '', 0, '', '', $newlinetext);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelinestoproduce" class="noborder noshadow nobottom centpercent">';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user