system.kanoa.schedule.calcEventDuration(assetId, startDate, qty, itemInfo)
This function will calculate the expected duration it will take to complete a production run for a given item
Parameters
assetId Integer: Id of asset
startDate DateTime: Start date of when to schedule
qty Float: Quantity to schedule
itemInfo Dictionary: Information about the item to be scheduled
| - infeedUnits | String | |
| - itemPeriodName | String | |
| - packageCount | Float | |
| - scheduleRate | Float |
Returns
durationMins Integer Calculated duration in minutes
msg String None if success
durationCalcLogs List of Strings Details on how the duration was calculated
Example
assetId = 901
startDate = system.date.now()
qty = 100.0
itemInfo = {
'infeedUnits': 'ea',
'itemPeriodName': 'Minute',
'packageCount': 1.0,
'scheduleRate': 485.5
}
durationMins, msg, durationCalcLogs = system.kanoa.schedule.calcEventDuration(assetId, startDate, qty, itemInfo)