fleetmap-reports 1.0.326 → 1.0.327

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.326",
3
+ "version": "1.0.327",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -411,10 +411,15 @@ function exportKmsReportToExcel(userData, reportData) {
411
411
  }
412
412
  })
413
413
 
414
- data = data.concat({
415
- licenseplate: 'Total',
416
- distance: data.reduce((prev, curr) => curr.distance ? {distance: (prev.distance || 0) + curr.distance} : prev).distance
417
- })
414
+ // add total
415
+ if (data.length) {
416
+ data = data.concat({
417
+ name: '',
418
+ group: '',
419
+ licenseplate: 'Total',
420
+ distance: data.reduce((prev, curr) => curr.distance ? {distance: (prev.distance || 0) + curr.distance} : prev).distance
421
+ })
422
+ }
418
423
 
419
424
  return {
420
425
  headers,