fleetmap-reports 1.0.441 → 1.0.444

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.441",
3
+ "version": "1.0.444",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -261,7 +261,7 @@ function getAlertInfo (drivers, alert) {
261
261
  const driver = drivers.find(d => d.uniqueId === alert.attributes.driverUniqueId)
262
262
  return driver ? driver.name : alert.attributes.driverUniqueId
263
263
  }
264
- return ''
264
+ return alert.driver
265
265
  }
266
266
 
267
267
  function getAlertDate (user, alert) {
@@ -76,7 +76,7 @@ async function createSpeedingReportByDevice (from, to, userData, traccarInstance
76
76
  xpert: devices.filter(d => d && d.attributes && d.attributes.xpert).length > 0
77
77
  }
78
78
 
79
- const sliced = automaticReports.sliceArray(devices, 20)
79
+ const sliced = automaticReports.sliceArray(devices, 10)
80
80
 
81
81
  let deviceCount = 0
82
82
  for (const slice of sliced) {
@@ -276,7 +276,7 @@ async function exportTripReportToPDF (userData, reportData) {
276
276
  tripsData.forEach(function (d, index) {
277
277
  const data = []
278
278
  const name = userData.byDriver ? d.driver.name : deviceName(d.device)
279
- const group = userData.byDriver ? userData.groups.find(g => g.drivers.includes(d.id)) : userData.groups.find(g => d.device.groupId === g.id)
279
+ const group = userData.byDriver ? userData.groups.find(g => g.drivers && g.drivers.includes(d.id)) : userData.groups.find(g => d.device.groupId === g.id)
280
280
 
281
281
  const space = index === 0 ? 8 : 0
282
282
  if (index) {