Skip to main content

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 TypeExample URL
POST{{url_base}}/PostAddMaterialMonthlyAverageCost
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddMaterialMonthlyAverageCost"

Input Parameters

ParameterTypeRequiredDescription
BranchNoString(25)YesExternal branch code
PeriodString(40)YesPeriod (Month + Year)
OverwriteIfExistsBooleanNoFlag indicating that data should be overwritten if the record already exists
ItemListAddMaterialMonthlyAverageCostItemListYesList 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

ParameterTypeRequiredDescription
MaterialNoString(25)YesExternal Material code
AverageCostFloatYesAverage unit value of consumed material

Return

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard 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

CodeMessage
AMM‑001Monthly Cost has already been processed for Period (PeriodNo) [value sent in request] and Branch (BranchNo) [value sent in request] informed. Operation not allowed!
AMM‑002The Material Monthly Average Cost already exists for Period (PeriodNo) [value sent in request] and Branch (BranchNo) [value sent in request] informed. Operation not allowed!