fleetmap-reports 1.0.425 → 1.0.426

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.425",
3
+ "version": "1.0.426",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -80,7 +80,7 @@ async function createSpeedingReportByDevice (from, to, userData, traccarInstance
80
80
 
81
81
  let deviceCount = 0
82
82
  for (const slice of sliced) {
83
- const { routes, events } = await getEvents(traccarInstance, from, to, slice, userData)
83
+ const { routes, events } = await getEvents(traccarInstance, from, to, slice, userData, deviceCount, devices.length)
84
84
  if (events.length > 0) {
85
85
  const devicesProcessed = await processDevices(from, to, slice, events, routes, userData)
86
86
  allData.devices.push(...devicesProcessed)
@@ -110,11 +110,11 @@ async function createSpeedingReportByDriver (from, to, userData, traccarInstance
110
110
  return { drivers: await processDrivers(from, to, events, routes, userData) }
111
111
  }
112
112
 
113
- async function getEvents (traccarInstance, from, to, devices, userData) {
113
+ async function getEvents (traccarInstance, from, to, devices, userData, deviceCount, totalDevices) {
114
114
  const geofencesFeatures = userData.geofences.filter(g => g.area.startsWith('POLYGON') &&
115
115
  g.attributes.speedLimit).map(g => convertToFeature(g))
116
116
 
117
- const allInOne = await traccarHelper.getAllInOne(traccarInstance, from, to, devices, true, false, false, false)
117
+ const allInOne = await traccarHelper.getAllInOne(traccarInstance, from, to, devices, true, false, false, false, deviceCount, totalDevices)
118
118
  const routes = allInOne.route
119
119
 
120
120
  const events = []