fleetmap-reports 1.0.609 → 1.0.610

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.609",
3
+ "version": "1.0.610",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -5,6 +5,7 @@ const utils = require('../util/utils')
5
5
 
6
6
  // eslint-disable-next-line no-undef
7
7
  describe('Test_Reports', function () {
8
+ this.timeout(5000000)
8
9
  it('converts to pdf', async () => {
9
10
  const report = await getReports()
10
11
  const userData = await report.getUserData()
@@ -169,7 +169,7 @@ function processDevices (from, to, devices, data, userData, traccar) {
169
169
  trip.endPOIName = nearestPOIs[0].p.name
170
170
  }
171
171
 
172
- if ((deviceRoute[0].protocol === 'teltonika' && deviceRoute[0].attributes.fuel) ||
172
+ if ((deviceRoute[0].protocol === 'teltonika' && deviceRoute.some(r => r.attributes.fuel)) ||
173
173
  automaticReports.deviceWithFuelInfo(d)) {
174
174
  trip.fuelConsumption = trip.spentFuel
175
175
  trip.avgFuelConsumption = trip.totalKms > 0 ? trip.fuelConsumption * 100 / trip.totalKms : 0