fleetmap-reports 2.0.340 → 2.0.342

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": "2.0.340",
3
+ "version": "2.0.342",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -88,7 +88,7 @@ async function createKmsReportByDevice (from, to, userData, traccarInstance) {
88
88
  trips,
89
89
  route,
90
90
  summary
91
- } = await traccar.getAllInOne(traccarInstance, from, to, devices, needRoute, true, false, !userData.groupByDay, deviceCount, allDevices.length, 10, 2)
91
+ } = await traccar.getAllInOne(traccarInstance, from, to, devices, needRoute, true, false, !userData.groupByDay, deviceCount, allDevices.length, 10, 1)
92
92
 
93
93
  allData.devices = allData.devices.concat(await processDevices(from, to, devices, {
94
94
  trips,
@@ -535,7 +535,7 @@ function getExcelContent (userData, d, translations) {
535
535
  name: userData.byDriver ? d.driver.name : d.device.name,
536
536
  group: group ? group.name : '',
537
537
  licenseplate: userData.byDriver ? '' : d.device.attributes.license_plate,
538
- distance: Number((d.summary.distance / 1000).toFixed(0))
538
+ distance: d.summary ? Number((d.summary.distance / 1000).toFixed(0)) : 0
539
539
  })
540
540
  }
541
541
  return data