Skip to main content

system.kanoa.cmms.getMaintenanceLaborHoursByWorkOrder(paramsDict)

Returns technician hours, procedure step hours, total duration (created/open through completed), and active duration (time in the 'In Progress' status) for the given period, grouped by work order event - these are different kinds of measurement (labor logged vs. wall-clock elapsed) and are deliberately not summed together. technicianCount is how many distinct people worked each event. Only work orders with logged hours are returned. When assetId is an area/site, includes every descendant asset's work orders rather than requiring a specific leaf asset.


Parameters

paramsDict Dictionary

- assetIdIntegerNot required restricts to this asset and its descendants
- endDateDateTimeEnd date
- startDateDateTimeStart date

Returns

laborHoursByWorkOrder pyDataset


Example

paramsDict = {
'startDate': system.date.addDays(system.date.now(), -90),
'endDate': system.date.now()
}

data = system.kanoa.utilities.convertDatasetToJSON(system.kanoa.cmms.getMaintenanceLaborHoursByWorkOrder(paramsDict))

for i, row in enumerate(data):
print 'Row %i'%i
for k,v in row.items():
print k,v

break
>>>
Row 0
technicianCount 1
workOrderEventName MWO00197
procedureStepHours 0.0
title WWW
activeDurationHours 0.0
assetName None
workOrderEventId 16
technicianHours 2.77
totalDurationHours 14.35
>>>