fleetmap-reports 1.0.606 → 1.0.608

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.606",
3
+ "version": "1.0.608",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -292,7 +292,9 @@ async function exportTripReportToPDF (userData, reportData) {
292
292
 
293
293
  tripsData.forEach(function (d, index) {
294
294
  const data = []
295
- const name = userData.byDriver ? d.driver.name : deviceName(d.device)
295
+ const name = userData.byDriver
296
+ ? d.driver.name + ((d.driver.attributes && d.driver.attributes.notes) || '')
297
+ : deviceName(d.device)
296
298
  const group = userData.byDriver ? userData.groups.find(g => g.drivers && g.drivers.includes(d.id)) : userData.groups.find(g => d.device.groupId === g.id)
297
299
 
298
300
  const space = index === 0 ? 8 : 0
@@ -487,7 +489,9 @@ function getTripEnd (user, trip) {
487
489
  function getDriverName (drivers, driverUniqueId) {
488
490
  if (driverUniqueId) {
489
491
  const driver = drivers.find(d => d.uniqueId === driverUniqueId)
490
- return driver ? driver.name : driverUniqueId
492
+ return driver
493
+ ? driver.name + ' ' + ((driver.attributes && driver.attributes.notes) || '')
494
+ : driverUniqueId
491
495
  }
492
496
 
493
497
  return ''