fleetmap-reports 1.0.218 → 1.0.219

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.218",
3
+ "version": "1.0.219",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -69,7 +69,7 @@ function processDevices(from, to, devices, data) {
69
69
  const dayLocations = groupedLocations.get(key)
70
70
  const day = {
71
71
  date: key,
72
- kms: dayLocations.reduce((a, b) => a + b.attributes.distance, 0)
72
+ kms: dayLocations.reduce((a, b) => a + (b.attributes.distance || 0), 0)
73
73
  }
74
74
  days.push(day)
75
75
  })
@@ -263,7 +263,7 @@ function exportKmsReportToExcel(userData, reportData) {
263
263
  name: userData.byDriver ? d.driver.name : d.device.name,
264
264
  group: group ? group.name : '',
265
265
  date: a.date,
266
- distance: Number((a.kms / 1000).toFixed(0))
266
+ distance: Number(((a.kms || 0) / 1000).toFixed(0))
267
267
  }
268
268
  }))
269
269
  } else {