diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 6af61126fe6..970676c34b6 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -103,7 +103,7 @@ if ($action == 'cancel_record' && $permissiontoadd) { $object->setCanceled($user); } -if ($action == 'update' && $user->rights->stock->mouvement->creer) { +if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) { $stockmovment = new MouvementStock($db); $stockmovment->origin = $object; @@ -160,7 +160,7 @@ if ($action == 'update' && $user->rights->stock->mouvement->creer) { } } -if (($action == 'record' || $action =='updateinventorylines') && $permissiontoadd) { +if ($action =='updateinventorylines' && $permissiontoadd) { $sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,'; $sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated'; $sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id'; @@ -301,16 +301,19 @@ llxHeader('', $langs->trans('Inventory'), $help_url); // Disable button Generate movement if data were not saved print ''; @@ -466,7 +469,7 @@ if ($object->id > 0) { // Save if ($object->status == $object::STATUS_VALIDATED) { if ($permissiontoadd) { - print 'id.'&action=record&token='.newToken().'">'.$langs->trans("MakeMovementsAndClose").''."\n"; + print 'id.'&action=record&token='.newToken().'" title="'.dol_escape_htmltag("SaveQtyFirst").'">'.$langs->trans("MakeMovementsAndClose").''."\n"; } else { print ''.$langs->trans('MakeMovementsAndClose').''."\n"; } @@ -598,6 +601,7 @@ if ($object->id > 0) { $num = $db->num_rows($resql); $i = 0; + $totalfound = 0; $totalarray = array(); while ($i < $num) { $obj = $db->fetch_object($resql); @@ -647,6 +651,7 @@ if ($object->id > 0) { print '