fleetmap-reports 2.0.171 → 2.0.172

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.171",
3
+ "version": "2.0.172",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/util/trips.js CHANGED
@@ -217,7 +217,8 @@ function shouldRecalculate (trip, route) {
217
217
 
218
218
  function getTripTotalKms (trip, stop, route) {
219
219
  // 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
220
- const stopKms = stop && (stop.endOdometer - stop.startOdometer)
220
+ const stopKms = stop &&
221
+ !route.find(p => p.attributes.putAccumulators) && (stop.endOdometer - stop.startOdometer)
221
222
  let distance = trip.distance + (stop && stopKms > 0 ? stopKms : 0)
222
223
  if (shouldRecalculate(trip, route)) {
223
224
  distance = 0