fleetmap-reports 1.0.801 → 1.0.803

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.801",
3
+ "version": "1.0.803",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -166,7 +166,7 @@ function processDevices (from, to, devices, data, userData) {
166
166
  const toByDay = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59)
167
167
 
168
168
  const tripsByDay = trips.filter(t => (new Date(t.startTime) > fromByDay && new Date(t.endTime) < toByDay))
169
- const routeByDay = trips.filter(p => (new Date(p.fixTime) > fromByDay && new Date(p.fixTime) < toByDay))
169
+ const routeByDay = deviceRoute.filter(p => (new Date(p.fixTime) > fromByDay && new Date(p.fixTime) < toByDay))
170
170
  const distance = tripsByDay.reduce((a, b) => a + b.distance, 0)
171
171
 
172
172
  if (!userData.allWeek && userData.weekDays && userData.dayHours) {
@@ -401,7 +401,7 @@ function exportActivityReportToPDFVehicle (doc, translations, reportData, userDa
401
401
  Math.round(d.summary[0].averageSpeed * 1.85200),
402
402
  Math.round(d.summary[0].maxSpeed * 1.85200),
403
403
  convertMS(d.summary[0].engineHours),
404
- d.summary[0].convertedSpentFuel >= 0 ? d.summary[0].convertedSpentFuel : 0
404
+ Math.round(d.summary[0].convertedSpentFuel >= 0 ? d.summary[0].convertedSpentFuel : 0)
405
405
  ]
406
406
  data.push(temp)
407
407
  }
@@ -457,7 +457,7 @@ function exportActivityReportToPDFVehicleGroupByDay (doc, translations, reportDa
457
457
  Math.round(s.averageSpeed * 1.85200),
458
458
  Math.round(s.maxSpeed * 1.85200),
459
459
  convertMS(s.engineHours),
460
- s.convertedSpentFuel >= 0 ? s.convertedSpentFuel : 0
460
+ Math.round(s.convertedSpentFuel >= 0 ? s.convertedSpentFuel : 0)
461
461
  ]
462
462
 
463
463
  data.push(temp)
@@ -522,7 +522,7 @@ function exportActivityReportToExcelVehicleGroupByDay (settings, translations, r
522
522
  avgSpeed: Math.round(s.averageSpeed * 1.85200),
523
523
  maxSpeed: Math.round(s.maxSpeed * 1.85200),
524
524
  engineHours: convertMS(s.engineHours),
525
- spentFuel: s.convertedSpentFuel >= 0 ? s.convertedSpentFuel : 0
525
+ spentFuel: Math.round(s.convertedSpentFuel >= 0 ? s.convertedSpentFuel : 0)
526
526
  }
527
527
  }))
528
528
  })
@@ -721,7 +721,7 @@ function exportActivityReportToExcelVehicle (settings, translations, reportData,
721
721
  avgSpeed: Math.round(d.summary[0].averageSpeed * 1.85200),
722
722
  maxSpeed: Math.round(d.summary[0].maxSpeed * 1.85200),
723
723
  engineHours: convertMS(d.summary[0].engineHours),
724
- spentFuel: d.summary[0].convertedSpentFuel >= 0 ? d.summary[0].convertedSpentFuel : 0
724
+ spentFuel: Math.round(d.summary[0].convertedSpentFuel >= 0 ? d.summary[0].convertedSpentFuel : 0)
725
725
  }])
726
726
  }
727
727
  })