fleetmap-reports 2.0.341 → 2.0.343

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": "2.0.341",
3
+ "version": "2.0.343",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -88,7 +88,7 @@ async function createKmsReportByDevice (from, to, userData, traccarInstance) {
88
88
  trips,
89
89
  route,
90
90
  summary
91
- } = await traccar.getAllInOne(traccarInstance, from, to, devices, needRoute, true, false, !userData.groupByDay, deviceCount, allDevices.length, 10, 2)
91
+ } = await traccar.getAllInOne(traccarInstance, from, to, devices, needRoute, true, false, !userData.groupByDay, deviceCount, allDevices.length, 10, 1)
92
92
 
93
93
  allData.devices = allData.devices.concat(await processDevices(from, to, devices, {
94
94
  trips,
package/src/util/trips.js CHANGED
@@ -219,7 +219,9 @@ function shouldRecalculate (trip, route) {
219
219
  function getTripTotalKms (trip, stop, route) {
220
220
  // we need to add stop kms to ensure that the total kms for the day, calculated with the odometer difference, will be equal to the sum of kms of all trips
221
221
  const stopKms = stop &&
222
- !route.find(p => p.attributes.putAccumulators) && (stop.endOdometer - stop.startOdometer)
222
+ !route.find(p => p.attributes.putAccumulators
223
+ || p.protocol === 'startek') //fix ticket 2263
224
+ && (stop.endOdometer - stop.startOdometer)
223
225
  let distance = trip.distance + (stop && stopKms > 0 ? stopKms : 0)
224
226
  if (shouldRecalculate(trip, route)) {
225
227
  distance = 0