fleetmap-reports 2.0.33 → 2.0.34

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.33",
3
+ "version": "2.0.34",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -117,7 +117,7 @@ async function createKmsReportByDriver (from, to, userData, traccarInstance) {
117
117
  report.drivers = drivers
118
118
  })
119
119
  } else {
120
- const results = await reportByDriver(userData.devices, traccarInstance, from, to, userData, processDrivers, { route: true, trips: true, stops: false, summary: false })
120
+ const results = await reportByDriver(userData.devices, traccarInstance, from, to, userData, processDrivers, { route: !userData.allWeek, trips: true, stops: false, summary: false })
121
121
 
122
122
  results.drivers.forEach(result => {
123
123
  const driver = report.drivers.find(d => d.driver.id === result.driver.id)
@@ -56,7 +56,7 @@ function getDriverName (driverUniqueId, date, userData) {
56
56
  return timeline.driverName
57
57
  }
58
58
 
59
- const driver = userData.drivers.find(d => !d.uniqueId.localeCompare(driverUniqueId, undefined, { sensitivity: 'base' }))
59
+ const driver = userData.drivers ? userData.drivers.find(d => !d.uniqueId.localeCompare(driverUniqueId, undefined, { sensitivity: 'base' })) : undefined
60
60
 
61
61
  return driver
62
62
  ? driver.name + ' ' + ((driver.attributes && driver.attributes.notes) || '')