From 5f33f3d5848bb764fd5a676b83f882b78a636d09 Mon Sep 17 00:00:00 2001 From: lukasha12 <66280366+lukasha12@users.noreply.github.com> Date: Mon, 12 Oct 2020 23:04:15 +0200 Subject: FIX distance calculation. Fixing distance calculation condition. --- src/main/java/org/traccar/reports/ReportUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/org/traccar/reports') diff --git a/src/main/java/org/traccar/reports/ReportUtils.java b/src/main/java/org/traccar/reports/ReportUtils.java index 9a22b5f9b..af686ba20 100644 --- a/src/main/java/org/traccar/reports/ReportUtils.java +++ b/src/main/java/org/traccar/reports/ReportUtils.java @@ -97,7 +97,7 @@ public final class ReportUtils { double firstOdometer = firstPosition.getDouble(Position.KEY_ODOMETER); double lastOdometer = lastPosition.getDouble(Position.KEY_ODOMETER); - if (useOdometer && (firstOdometer != 0.0 || lastOdometer != 0.0)) { + if (useOdometer && firstOdometer != 0.0 && lastOdometer != 0.0) { distance = lastOdometer - firstOdometer; } else if (firstPosition.getAttributes().containsKey(Position.KEY_TOTAL_DISTANCE) && lastPosition.getAttributes().containsKey(Position.KEY_TOTAL_DISTANCE)) { -- cgit v1.2.3