fleetmap-reports 1.0.822 → 1.0.823

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.822",
3
+ "version": "1.0.823",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -195,7 +195,7 @@ async function processDevices (from, to, devices, userData, data) {
195
195
  outGeofenceName: a.geofenceName,
196
196
  inTime: zoneInOutData[index + 1].inTime,
197
197
  inGeofenceName: zoneInOutData[index + 1].geofenceName,
198
- distanceOut: a.distanceOut,
198
+ distanceOut: a.distanceOutAny,
199
199
  totalOutTime: new Date(zoneInOutData[index + 1].inTime.fixTime).getTime() - new Date(a.outTime.fixTime).getTime()
200
200
  })
201
201
  }
@@ -339,7 +339,7 @@ function analyseAlerts (alerts, deviceRoute, userData, from, to) {
339
339
  new Date(p.fixTime).getTime() >= outDate &&
340
340
  new Date(p.fixTime).getTime() < anyNextIn
341
341
  )
342
- const distanceOutAny = zoneInData.length < 2 ? calculateDistance(routeAfterOutAndBeforeAnyNextIn) : 0
342
+ const distanceOutAny = Object.keys(zoneInData).length < 2 ? calculateDistance(routeAfterOutAndBeforeAnyNextIn) : 0
343
343
 
344
344
  if (zoneInData[a.geofenceId]) {
345
345
  const totalInTime = new Date(a.position.fixTime).getTime() - new Date(zoneInData[a.geofenceId].position.fixTime).getTime()
@@ -361,7 +361,7 @@ function analyseAlerts (alerts, deviceRoute, userData, from, to) {
361
361
  stopped: routeIn.filter(p => !p.attributes.ignition).length > 0,
362
362
  driverName: zoneInData[a.geofenceId].position.driverName
363
363
  })
364
- zoneInData[a.geofenceId] = null
364
+ delete zoneInData[a.geofenceId]
365
365
  } else {
366
366
  const totalInTime = new Date(a.position.fixTime).getTime() - from.getTime()
367
367
  const routeIn = deviceRoute.filter(p =>