Stock Movements
Context of use
The webservices described below relate to the management of stock movements used in MES Operations. Stock movements include all movements affecting the stock level, whether they have been triggered by manufacturing (consumption, production) or miscellaneous movements (inputs, outputs, transfers,…)
Theses webservices can be used for example in the case where stock management is shared between the MES and other software (ERP, WMS…). In certain simple cases, stock movements can be used to manage entries on MO (Manufacturing Orders).
For the entity "Stock Movements", one operation is available :
-
Get a paginated list of stock movements
Endpoints
Get stock movements
Description
This endpoint allows to get a list of stock movements by selecting a range of last modification dates (from / to). The end limit is not compulsory ; in a normal use context, where all modifications are expected, the selection relates only to the start date (all movements since…). However, in the case of data recovery for a certain period of time, the use of the date range is possible.
/companies/{companycode}/establishments/{establishmentcode}/stock-movements |
Parameters
Type | Name | Description | Schema | Associated rules |
---|---|---|---|---|
Path |
companyCode |
Current context company code |
string |
|
Path |
establishmentCode |
Current context establishment code |
string |
|
Query |
page |
Page index |
int |
|
Query |
size |
Entity count per page |
int |
|
Query |
from |
Movement created, updated or deleted since |
datetime (ISO-8601) |
|
Query |
to |
To get a range in the past : Movement created, updated or deleted since / to |
datetime (ISO-8601) |
|
Query |
natureCodes |
Filter on natures |
list<string> |
|
Query |
depotCodes |
Filter on depots |
list<string> |
Rules
R2
NatureCodes : list of the natures to get. The list can include manufacturing natures (MO_IN and MO_OUT) and natures of miscellaneous movements. If the list of natures is empty, all the movements, whatever their nature, will be get.
R3
DepotCodes : list of depots to get. If the list of depots is empty, all the movements, whatever their depot, will be get.
Data structure
PaginatedList<StockMovement>
Description of a pagined list of stock movements
Name | Description | Value | Associated rules |
---|---|---|---|
paging |
Paging |
||
data |
List of stock movements |
List<StockMovement > |
StockMovement
Description of a stock movement
Name | Description | Value | Associated rules |
---|---|---|---|
companyCode |
Company code |
string |
|
establishmentCode |
Establishment code |
string |
|
action |
Specify if it’s a creation, an update or a deletion |
string (CREATE, UPDATE, DELETE) |
|
movementDate |
Date of taking into account the input in stock |
datetime (ISO-8601) |
|
lastModifiedDate |
Date of last modification (creation, update, or deletion) ; it’s the reference date of "from-to" filter |
datetime (ISO-8601) |
|
direction |
Specify if it’s an input or output movement |
string (INPUT, OUTPUT) |
|
natureCode |
nature code |
string |
|
itemBatchQuantities |
Detail of the material moved |
||
container |
Informations about container |
||
localisation |
Geographical origin or destination of the movement |
||
movementId |
Unique movement reference. Identical value for all movements of the same action. |
long |
|
domain |
Initiating function domain |
string (MANUFACTURING, MISCELLEANOUS_MOVEMENT) |
|
domainInfos |
Specific information of initiating function (MO Number, …) |
DomainInfos
Content depends on "domain", i.e on the function with triggered the stock movement.
If domain = "MANUFACTURING"
Name | Description | Value | Associated rules |
---|---|---|---|
moNbExt |
External mo number. Can be a string or a number |
string |
|
moNb |
Internal Vif mo number |
string |
Rules
R4
If a stock movement is modified in the MES (e.g.: modification of a quantity on a miscellaneous movement), 2 movements are created:
-
a CANCEL movement of the old value
-
a REPLACE movement with the new
R5
If the stock movement has been triggered by the domain "manufact", the natureCode will be a nature code managed by MES, as following :
-
manufacturing input (stock output) : nature code is MO_IN
-
manufacturing output (stock input) : nature code is MO_OUT
If the stock movement has been triggered by a miscellaneous movement, the nature will be the nature of the miscellaneous movement used by the operator.