Monthly Average Cost per Consumed Material
The PostAddMaterialMonthlyAverageCost endpoint performs the registration of monthly average cost per consumed materials performed in ERP in the MIMS system.
How to register monthly average cost
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddMaterialMonthlyAverageCost |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddMaterialMonthlyAverageCost" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| BranchNo | String(25) | Yes | External branch code |
| Period | String(40) | Yes | Period (Month + Year) |
| OverwriteIfExists | Boolean | No | Flag indicating that data should be overwritten if the record already exists |
| ItemList | AddMaterialMonthlyAverageCostItemList | Yes | List of all materials consumed in the period |
📝 AddMaterialMonthlyAverageCostItemList Object
The AddMaterialMonthlyAverageCostItemList object represents the monthly average cost of a material consumed in ERP.
Input Parameters
Parameter Type Required Description MaterialNo String(25) Yes External Material code AverageCost Float Yes Average unit value of consumed material
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information on method execution |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddMaterialMonthlyAverageCost"' \
--header 'Content-Type: application/json' \
--data '{
"BranchNo": "101",
"Period": "01/2022",
"OverwriteIfExists": true,
"ItemList": [
{
"MaterialNo": "3000",
"AverageCost": 0.004
},
{
"MaterialNo": "3001",
"AverageCost": 200.121
}
]
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
}
}
🐞 Possible Errors
| Code | Message |
|---|---|
| AMM‑001 | Monthly Cost has already been processed for Period (PeriodNo) [value sent in request] and Branch (BranchNo) [value sent in request] informed. Operation not allowed! |
| AMM‑002 | The Material Monthly Average Cost already exists for Period (PeriodNo) [value sent in request] and Branch (BranchNo) [value sent in request] informed. Operation not allowed! |