FIX wrong list of stock mvt after right/left on a warehouse
This commit is contained in:
parent
3abb3f5018
commit
b1038e0d48
@ -445,7 +445,7 @@ class Entrepot extends CommonObject
|
||||
if ($id) {
|
||||
$sql .= " WHERE rowid = ".((int) $id);
|
||||
} else {
|
||||
$sql .= " WHERE entity = ".$conf->entity;
|
||||
$sql .= " WHERE entity IN (".getEntity('stock').")";
|
||||
if ($ref) {
|
||||
$sql .= " AND ref = '".$this->db->escape($ref)."'";
|
||||
}
|
||||
|
||||
@ -49,9 +49,6 @@ if (!empty($conf->productbatch->enabled)) {
|
||||
$langs->load("productbatch");
|
||||
}
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'stock');
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$msid = GETPOST('msid', 'int');
|
||||
@ -63,10 +60,6 @@ $cancel = GETPOST('cancel', 'alpha');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'movementlist';
|
||||
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||
|
||||
// Security check
|
||||
//$result=restrictedArea($user, 'stock', $id, 'entrepot&stock');
|
||||
$result = restrictedArea($user, 'stock');
|
||||
|
||||
$idproduct = GETPOST('idproduct', 'int');
|
||||
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
@ -146,6 +139,18 @@ if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
unset($arrayfields['pl.eatby']);
|
||||
}
|
||||
|
||||
|
||||
$tmpwarehouse = new Entrepot($db);
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$tmpwarehouse->fetch($id, $ref);
|
||||
$id = $tmpwarehouse->id;
|
||||
}
|
||||
|
||||
|
||||
// Security check
|
||||
//$result=restrictedArea($user, 'stock', $id, 'entrepot&stock');
|
||||
$result = restrictedArea($user, 'stock');
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->stock->mouvement->lire) {
|
||||
accessforbidden();
|
||||
@ -216,9 +221,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
if ($action == 'update_extras') {
|
||||
$tmpwarehouse = new Entrepot($db);
|
||||
$tmpwarehouse->fetch($id);
|
||||
|
||||
$tmpwarehouse->oldcopy = dol_clone($tmpwarehouse);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
|
||||
Loading…
Reference in New Issue
Block a user