forked from Wavyzz/dolibarr
Fix MRP
This commit is contained in:
@@ -1461,6 +1461,7 @@ if ($id > 0)
|
|||||||
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td>';
|
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td>';
|
||||||
print '<input type="text" name="priority" value="'.($object->priority ? $object->priority : '').'" size="5">';
|
print '<input type="text" name="priority" value="'.($object->priority ? $object->priority : '').'" size="5">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Object linked
|
// Object linked
|
||||||
if (!empty($object->fk_element) && !empty($object->elementtype))
|
if (!empty($object->fk_element) && !empty($object->elementtype))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1888,6 +1888,11 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
|
|||||||
$module='stock';
|
$module='stock';
|
||||||
$myobject='inventory';
|
$myobject='inventory';
|
||||||
}
|
}
|
||||||
|
elseif ($objecttype == 'mo') {
|
||||||
|
$classpath = 'mrp/class';
|
||||||
|
$module='mrp';
|
||||||
|
$myobject='mo';
|
||||||
|
}
|
||||||
|
|
||||||
// Generic case for $classfile and $classname
|
// Generic case for $classfile and $classname
|
||||||
$classfile = strtolower($myobject); $classname = ucfirst($myobject);
|
$classfile = strtolower($myobject); $classname = ucfirst($myobject);
|
||||||
|
|||||||
@@ -1013,3 +1013,4 @@ ContactDefault_supplier_proposal=Supplier Proposal
|
|||||||
ContactDefault_ticketsup=Ticket
|
ContactDefault_ticketsup=Ticket
|
||||||
ContactAddedAutomatically=Contact added from contact thirdparty roles
|
ContactAddedAutomatically=Contact added from contact thirdparty roles
|
||||||
More=More
|
More=More
|
||||||
|
ShowDetails=Show details
|
||||||
|
|||||||
@@ -60,6 +60,6 @@ TheProductXIsAlreadyTheProductToProduce=The product to add is already the produc
|
|||||||
ForAQuantityOf1=For a quantity to produce of 1
|
ForAQuantityOf1=For a quantity to produce of 1
|
||||||
ConfirmValidateMo=Are you sure you want to validate this Manufacturing Order?
|
ConfirmValidateMo=Are you sure you want to validate this Manufacturing Order?
|
||||||
ConfirmProductionDesc=By clicking on '%s', you will validate the consumption and/or production for the quantities set. This will also update the stock and record stock movements.
|
ConfirmProductionDesc=By clicking on '%s', you will validate the consumption and/or production for the quantities set. This will also update the stock and record stock movements.
|
||||||
ProductionForRefAndDate=Production %s - %s
|
ProductionForRef=Production of %s
|
||||||
AutoCloseMO=Close automatically the Manufacturing Order if quantities to consume and to produce are reached
|
AutoCloseMO=Close automatically the Manufacturing Order if quantities to consume and to produce are reached
|
||||||
NoStockChangeOnServices=No stock change on services
|
NoStockChangeOnServices=No stock change on services
|
||||||
@@ -242,7 +242,7 @@ if ($object->id > 0)
|
|||||||
$filters['search_agenda_label'] = $search_agenda_label;
|
$filters['search_agenda_label'] = $search_agenda_label;
|
||||||
|
|
||||||
// TODO Replace this with same code than into list.php
|
// TODO Replace this with same code than into list.php
|
||||||
//show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -577,9 +577,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
if ($action == 'consumeandproduceall')
|
if ($action == 'consumeandproduceall')
|
||||||
{
|
{
|
||||||
$defaultstockmovementlabel = GETPOST('inventorylabel', 'alphanohtml') ? GETPOST('inventorylabel', 'alphanohtml') : $langs->trans("ProductionForRefAndDate", $object->ref, dol_print_date(dol_now(), 'standard'));
|
$defaultstockmovementlabel = GETPOST('inventorylabel', 'alphanohtml') ? GETPOST('inventorylabel', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref);
|
||||||
//$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref.'_'.dol_print_date(dol_now(), 'dayhourlog');
|
//$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref.'_'.dol_print_date(dol_now(), 'dayhourlog');
|
||||||
$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref;
|
$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref);
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ConfirmProductionDesc", $langs->transnoentitiesnoconv("Confirm")).'<br></span>';
|
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ConfirmProductionDesc", $langs->transnoentitiesnoconv("Confirm")).'<br></span>';
|
||||||
@@ -654,8 +654,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.$alreadyconsumed.'</td>';
|
print '<td>'.$alreadyconsumed.'</td>';
|
||||||
print '<td>';
|
print '<td>'; // Warehouse
|
||||||
print '</td>'; // Warehouse
|
if ($alreadyconsumed) {
|
||||||
|
print '<script>';
|
||||||
|
print 'jQuery(document).ready(function() {
|
||||||
|
jQuery("#expandtoproduce'.$line->id.'").click(function() {
|
||||||
|
console.log("Expand mrp_production line '.$line->id.'");
|
||||||
|
jQuery(".expanddetail'.$line->id.'").toggle();
|
||||||
|
});
|
||||||
|
});';
|
||||||
|
print '</script>';
|
||||||
|
if (empty($conf->use_javascript_ajax)) print '<a href="'.$_SERVER["PHP_SELF"].'?collapse='.$collapse.','.$line->id.'">';
|
||||||
|
print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce'.$line->id.'"');
|
||||||
|
if (empty($conf->use_javascript_ajax)) print '</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
if ($conf->productbatch->enabled) {
|
if ($conf->productbatch->enabled) {
|
||||||
print '<td></td>'; // Lot
|
print '<td></td>'; // Lot
|
||||||
}
|
}
|
||||||
@@ -757,7 +770,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<td>'.$tmpproduct->getNomUrl(1).'</td>';
|
print '<td>'.$tmpproduct->getNomUrl(1).'</td>';
|
||||||
print '<td>'.$line->qty.'</td>';
|
print '<td>'.$line->qty.'</td>';
|
||||||
print '<td>'.$alreadyproduced.'</td>';
|
print '<td>'.$alreadyproduced.'</td>';
|
||||||
print '<td></td>'; // Warehouse
|
print '<td>'; // Warehouse
|
||||||
|
if ($alreadyproduced) {
|
||||||
|
print '<script>';
|
||||||
|
print 'jQuery(document).ready(function() {
|
||||||
|
jQuery("#expand'.$line->id.'").click(function() {
|
||||||
|
console.log("Expand mrp_production line '.$line->id.'");
|
||||||
|
jQuery(".expanddetail'.$line->id.'").toggle();
|
||||||
|
});
|
||||||
|
});';
|
||||||
|
print '</script>';
|
||||||
|
if (empty($conf->use_javascript_ajax)) print '<a href="'.$_SERVER["PHP_SELF"].'?collapse='.$collapse.','.$line->id.'">';
|
||||||
|
print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expand'.$line->id.'"');
|
||||||
|
if (empty($conf->use_javascript_ajax)) print '</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
if ($conf->productbatch->enabled) {
|
if ($conf->productbatch->enabled) {
|
||||||
print '<td></td>'; // Lot
|
print '<td></td>'; // Lot
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -941,6 +941,10 @@ class MouvementStock extends CommonObject
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
$origin = new Project($this->db);
|
$origin = new Project($this->db);
|
||||||
break;
|
break;
|
||||||
|
case 'mo':
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||||
|
$origin = new Mo($this->db);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ($origintype)
|
if ($origintype)
|
||||||
|
|||||||
@@ -674,9 +674,9 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
if ($id > 0) $param .= '&id='.$id;
|
if ($id > 0) $param .= '&id='.urlencode($id);
|
||||||
if ($search_movement) $param .= '&search_movement='.urlencode($search_movement);
|
if ($search_movement) $param .= '&search_movement='.urlencode($search_movement);
|
||||||
if ($search_inventorycode) $param .= '&search_inventorycode='.urlencode($search_inventorycode);
|
if ($search_inventorycode) $param .= '&search_inventorycode='.urlencode($search_inventorycode);
|
||||||
if ($search_type_mouvement) $param .= '&search_type_mouvement='.urlencode($search_type_mouvement);
|
if ($search_type_mouvement) $param .= '&search_type_mouvement='.urlencode($search_type_mouvement);
|
||||||
@@ -684,10 +684,8 @@ if ($resql)
|
|||||||
if ($search_product) $param .= '&search_product='.urlencode($search_product);
|
if ($search_product) $param .= '&search_product='.urlencode($search_product);
|
||||||
if ($search_batch) $param .= '&search_batch='.urlencode($search_batch);
|
if ($search_batch) $param .= '&search_batch='.urlencode($search_batch);
|
||||||
if ($search_warehouse > 0) $param .= '&search_warehouse='.urlencode($search_warehouse);
|
if ($search_warehouse > 0) $param .= '&search_warehouse='.urlencode($search_warehouse);
|
||||||
if (!empty($sref)) $param .= '&sref='.urlencode($sref); // FIXME $sref is not defined
|
|
||||||
if (!empty($snom)) $param .= '&snom='.urlencode($snom); // FIXME $snom is not defined
|
|
||||||
if ($search_user) $param .= '&search_user='.urlencode($search_user);
|
if ($search_user) $param .= '&search_user='.urlencode($search_user);
|
||||||
if ($idproduct > 0) $param .= '&idproduct='.$idproduct;
|
if ($idproduct > 0) $param .= '&idproduct='.urlencode($idproduct);
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user