diff --git a/ChangeLog b/ChangeLog index 020367a5453..49bb05ea2c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ English Dolibarr ChangeLog For Users: NEW: Module BOM is now stable. -NEW: Module MO - Manufacturing Order available with experimental status. +NEW: Module MO (Manufacturing Order) is available with experimental status. NEW: Can set the Address/Contact by default on third parties. NEW: Add a dictionary to edit list of Social networks. NEW: A nicer dashboard for open elements on Home page. diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index e3b5e159913..0d7fb48e45c 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -50,6 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; dol_include_once('/mrp/class/mo.class.php'); dol_include_once('/mrp/lib/mrp_mo.lib.php'); @@ -371,10 +372,10 @@ if (empty($reshook)) */ $form = new Form($db); -$formfile = new FormFile($db); $formproject = new FormProjets($db); $formproduct = new FormProduct($db); $tmpwarehouse = new Entrepot($db); +$tmpbatch = new Productlot($db); llxHeader('', $langs->trans('Mo'), ''); @@ -606,7 +607,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print load_fiche_titre($langs->trans('Consumption'), '', ''); print '
'; - print ''; + print '
'; print ''; print ''; @@ -664,7 +665,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea jQuery("#expandtoproduce'.$line->id.'").click(function() { console.log("Expand mrp_production line '.$line->id.'"); jQuery(".expanddetail'.$line->id.'").toggle();'; - if ($nblinetoconsume == $nblinetoconsumecursor) { + if ($nblinetoconsume == $nblinetoconsumecursor) { // If it is the last line print 'if (jQuery("#tablelines").hasClass("nobottom")) { jQuery("#tablelines").removeClass("nobottom"); } else { jQuery("#tablelines").addClass("nobottom"); }'; } print ' @@ -674,6 +675,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($conf->use_javascript_ajax)) print 'id.'">'; print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce'.$line->id.'"'); if (empty($conf->use_javascript_ajax)) print ''; + } else { + if ($nblinetoconsume == $nblinetoconsumecursor) { // If it is the last line + print ''; + } } print ' '.$alreadyconsumed; print ''; @@ -695,10 +700,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; + // Lot Batch + print ''; - print ''; print ''; } @@ -721,6 +732,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { print ''.$langs->trans("NoStockChangeOnServices").''; } + // Lot / Batch print ''; if ($conf->productbatch->enabled) { print ''; + print ''; - print ''; print ''; } diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index e2d954b2847..d02d1599dbc 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -220,9 +220,9 @@ class Productlot extends CommonObject /** * Load object in memory from the database * - * @param int $id Id object - * @param int $product_id Id of product, batch number parameter required - * @param string $batch batch number + * @param int $id Id of lot/batch + * @param int $product_id Id of product, batch number parameter required + * @param string $batch batch number * * @return int <0 if KO, 0 if not found, >0 if OK */ diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index c4ec988b269..c3eb7523e7d 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -336,17 +336,17 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Eat by print ''; print ''; // Sell by print ''; print '';
'.$langs->trans("Product").''; if ($line2['fk_warehouse'] > 0) { $tmpwarehouse->fetch($line2['fk_warehouse']); - print $tmpwarehouse->getNomUrl(); + print $tmpwarehouse->getNomUrl(1); + } + print ''; + if ($line2['batch'] != '') { + $tmpbatch->fetch(0, $line2['fk_product'], $line2['batch']); + print $tmpbatch->getNomUrl(1); } print ''.$line2['batch'].'
'; @@ -826,10 +838,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; if ($line2['fk_warehouse'] > 0) { $tmpwarehouse->fetch($line2['fk_warehouse']); - print $tmpwarehouse->getNomUrl(); + print $tmpwarehouse->getNomUrl(1); + } + print ''; + if ($line2['batch'] != '') { + $tmpbatch->fetch(0, $line2['fk_product'], $line2['batch']); + print $tmpbatch->getNomUrl(1); } print ''.$line2['batch'].'
'; - print $form->editfieldkey($langs->trans('Eatby'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker'); + print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker'); print ''; - print $form->editfieldval($langs->trans('Eatby'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker'); + print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker'); print '
'; - print $form->editfieldkey($langs->trans('Sellby'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); + print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); print ''; - print $form->editfieldval($langs->trans('Sellby'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); + print $form->editfieldval($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); print '