Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions htdocs/product/stock/class/api_stockmovements.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,33 @@ public function __construct()
*
* Return an array with stock movement information
*
* @since 5.0.0 Initial implementation
* @since 23.0.0 Initial implementation
*
* @param int $id ID of stock movement
* @return Object Stock movement object with cleaned properties
*
* @param int $id ID of movement
* @return Object Object with cleaned properties
* @url GET {id}
*
* @throws RestException
* @throws RestException 400 Bad Request
* @throws RestException 403 Not allowed
* @throws RestException 404 Not found
* @throws RestException 500 Internal Server Error
*/
/*
public function get($id)
{
if (!DolibarrApiAccess::$user->hasRight('stock', 'lire')) {
if (!DolibarrApiAccess::$user->hasRight('stock', 'mouvement', 'lire')) {
throw new RestException(403);
}

if ($id == 0) {
throw new RestException(400, 'No stock movement with id 0 can exist');
}
$result = $this->stockmovement->fetch($id);
if (!$result ) {
throw new RestException(404, 'warehouse not found');
}

if (!DolibarrApi::_checkAccessToResource('warehouse',$this->stockmovement->id)) {
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(404, 'stock movement not found');
}

return $this->_cleanObjectDatas($this->stockmovement);
}*/
}

/**
* Get a list of stock movements
Expand Down
Loading