fleetmap-reports 1.0.363 → 1.0.364

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.363",
3
+ "version": "1.0.364",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -205,7 +205,7 @@ function processDevices(from, to, devices, data, userData) {
205
205
  s.distance = deviceTrips.reduce((a, b) => a + b.distance, 0)
206
206
  s.convertedSpentFuel = automaticReports.calculateSpentFuel(s.spentFuel, d)
207
207
  s.startTime = deviceTrips.length && deviceTrips[0].startTime
208
- s.endTime = uncompletedTripRoute.length ? uncompletedTripRoute[uncompletedTripRoute.length-1].fixTime : (deviceTrips.length && deviceTrips[deviceTrips.length-1].endTime)
208
+ s.endTime = deviceTrips.length && deviceTrips[deviceTrips.length-1].endTime
209
209
  })
210
210
  }
211
211
  }
package/src/util/trips.js CHANGED
@@ -174,6 +174,11 @@ function calculateTrip(device, route) {
174
174
  startLon: startPos.longitude,
175
175
  startTime: startPos.fixTime,
176
176
  startAddress: startPos.address,
177
+ endLat: endPos.latitude,
178
+ endLon: endPos.longitude,
179
+ endTime: endPos.fixTime,
180
+ endAddress: endPos.address,
181
+ endTimeIsOut: true,
177
182
  duration: new Date(endPos.fixTime).getTime() - new Date(startPos.fixTime).getTime(),
178
183
  driverUniqueId: null,
179
184
  driverName: null