This commit is contained in:
florian HENRY 2019-02-13 15:30:20 +01:00
parent 5bb260d3d1
commit 020fa52507

View File

@ -47,7 +47,7 @@ $langs->loadLangs(array('products', 'stocks', 'orders'));
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch"); if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
// Security check // Security check
$result=restrictedArea($user,'stock'); $result=restrictedArea($user, 'stock');
$id=GETPOST('id', 'int'); $id=GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
@ -69,7 +69,7 @@ $search_inventorycode = trim(GETPOST("search_inventorycode", 'alpha'));
$search_user = trim(GETPOST("search_user", 'alpha')); $search_user = trim(GETPOST("search_user", 'alpha'));
$search_batch = trim(GETPOST("search_batch", 'alpha')); $search_batch = trim(GETPOST("search_batch", 'alpha'));
$search_qty = trim(GETPOST("search_qty", 'alpha')); $search_qty = trim(GETPOST("search_qty", 'alpha'));
$search_type_mouvement=GETPOST('search_type_mouvement','int'); $search_type_mouvement=GETPOST('search_type_mouvement', 'int');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$page = GETPOST("page", 'int'); $page = GETPOST("page", 'int');
@ -122,8 +122,8 @@ $usercanread = (($user->rights->stock->mouvement->lire));
$usercancreate = (($user->rights->stock->mouvement->creer)); $usercancreate = (($user->rights->stock->mouvement->creer));
$usercandelete = (($user->rights->stock->mouvement->supprimer)); $usercandelete = (($user->rights->stock->mouvement->supprimer));
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
@ -214,7 +214,7 @@ if ($action == "correct_stock")
$id, $id,
GETPOST("nbpiece", 'int'), GETPOST("nbpiece", 'int'),
GETPOST("mouvement", 'alpha'), GETPOST("mouvement", 'alpha'),
GETPOST("label",'san_alpha'), GETPOST("label", 'san_alpha'),
GETPOST('unitprice', 'alpha'), GETPOST('unitprice', 'alpha'),
GETPOST('inventorycode', 'alpha'), GETPOST('inventorycode', 'alpha'),
$origin_element, $origin_element,
@ -253,7 +253,7 @@ if ($action == "transfert_stock" && ! $cancel)
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors');
$action='transfert'; $action='transfert';
} }
if (! GETPOST("nbpiece",'int')) if (! GETPOST("nbpiece", 'int'))
{ {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors');
$error++; $error++;
@ -492,7 +492,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint; $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield, $sortorder);
$nbtotalofrecords = ''; $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@ -633,7 +633,7 @@ if ($resql)
print '<tr><td>'.$langs->trans("LastMovement").'</td><td>'; print '<tr><td>'.$langs->trans("LastMovement").'</td><td>';
if ($lastmovementdate) if ($lastmovementdate)
{ {
print dol_print_date($lastmovementdate,'dayhour'); print dol_print_date($lastmovementdate, 'dayhour');
} }
else else
{ {
@ -734,8 +734,8 @@ if ($resql)
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
if ($id > 0) print '<input type="hidden" name="id" value="'.$id.'">'; if ($id > 0) print '<input type="hidden" name="id" value="'.$id.'">';
if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,$massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit); if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit);
else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,$massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit);
if ($sall) if ($sall)
{ {
@ -886,7 +886,7 @@ if ($resql)
// Fields from hook // Fields from hook
$parameters=array('arrayfields'=>$arrayfields); $parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Date creation // Date creation
if (! empty($arrayfields['m.datec']['checked'])) if (! empty($arrayfields['m.datec']['checked']))
@ -961,7 +961,7 @@ if ($resql)
$arrayofuniqueproduct=array(); $arrayofuniqueproduct=array();
while ($i < min($num,$limit)) while ($i < min($num, $limit))
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
@ -1072,21 +1072,21 @@ if ($resql)
} }
if (! empty($arrayfields['m.type_mouvement']['checked'])) if (! empty($arrayfields['m.type_mouvement']['checked']))
{ {
// Type of movement // Type of movement
switch($objp->type_mouvement){ switch ($objp->type_mouvement) {
case "0": case "0" :
print '<td align="center">'.$langs->trans('StockIncreaseAfterCorrectTransfer').'</td>'; print '<td align="center">' . $langs->trans('StockIncreaseAfterCorrectTransfer') . '</td>';
break; break;
case "1": case "1" :
print '<td align="center">'.$langs->trans('StockDecreaseAfterCorrectTransfer').'</td>'; print '<td align="center">' . $langs->trans('StockDecreaseAfterCorrectTransfer') . '</td>';
break; break;
case "2": case "2" :
print '<td align="center">'.$langs->trans('StockDecrease').'</td>'; print '<td align="center">' . $langs->trans('StockDecrease') . '</td>';
break; break;
case "3": case "3" :
print '<td align="center">'.$langs->trans('StockIncrease').'</td>'; print '<td align="center">' . $langs->trans('StockIncrease') . '</td>';
break; break;
} }
} }
if (! empty($arrayfields['origin']['checked'])) if (! empty($arrayfields['origin']['checked']))
{ {