aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/reports/SummaryReportProvider.java14
-rw-r--r--templates/export/stops.xlsxbin15643 -> 13212 bytes
-rw-r--r--templates/export/summary.xlsxbin16889 -> 13233 bytes
-rw-r--r--templates/export/trips.xlsxbin15944 -> 13511 bytes
4 files changed, 3 insertions, 11 deletions
diff --git a/src/main/java/org/traccar/reports/SummaryReportProvider.java b/src/main/java/org/traccar/reports/SummaryReportProvider.java
index ffde0b067..5f155552b 100644
--- a/src/main/java/org/traccar/reports/SummaryReportProvider.java
+++ b/src/main/java/org/traccar/reports/SummaryReportProvider.java
@@ -105,15 +105,9 @@ public class SummaryReportProvider {
result.setDistance(PositionUtil.calculateDistance(first, last, !ignoreOdometer));
result.setSpentFuel(reportUtils.calculateFuel(first, last));
- long durationMilliseconds;
if (first.hasAttribute(Position.KEY_HOURS) && last.hasAttribute(Position.KEY_HOURS)) {
- durationMilliseconds = last.getLong(Position.KEY_HOURS) - first.getLong(Position.KEY_HOURS);
+ long durationMilliseconds = last.getLong(Position.KEY_HOURS) - first.getLong(Position.KEY_HOURS);
result.setEngineHours(durationMilliseconds);
- } else {
- durationMilliseconds = last.getFixTime().getTime() - first.getFixTime().getTime();
- }
-
- if (durationMilliseconds > 0) {
result.setAverageSpeed(UnitsConverter.knotsFromMps(result.getDistance() * 1000 / durationMilliseconds));
}
@@ -142,15 +136,13 @@ public class SummaryReportProvider {
if (daily) {
while (from.truncatedTo(ChronoUnit.DAYS).isBefore(to.truncatedTo(ChronoUnit.DAYS))) {
ZonedDateTime fromDay = from.truncatedTo(ChronoUnit.DAYS);
- ZonedDateTime nextDay = fromDay.plus(1, ChronoUnit.DAYS);
+ ZonedDateTime nextDay = fromDay.plusDays(1);
results.addAll(calculateDeviceResult(
device, Date.from(from.toInstant()), Date.from(nextDay.toInstant()), fast));
from = nextDay;
}
- results.addAll(calculateDeviceResult(device, Date.from(from.toInstant()), Date.from(to.toInstant()), fast));
- } else {
- results.addAll(calculateDeviceResult(device, Date.from(from.toInstant()), Date.from(to.toInstant()), fast));
}
+ results.addAll(calculateDeviceResult(device, Date.from(from.toInstant()), Date.from(to.toInstant()), fast));
return results;
}
diff --git a/templates/export/stops.xlsx b/templates/export/stops.xlsx
index 967d26309..4e7aaf422 100644
--- a/templates/export/stops.xlsx
+++ b/templates/export/stops.xlsx
Binary files differ
diff --git a/templates/export/summary.xlsx b/templates/export/summary.xlsx
index 47a6241b1..528b99f55 100644
--- a/templates/export/summary.xlsx
+++ b/templates/export/summary.xlsx
Binary files differ
diff --git a/templates/export/trips.xlsx b/templates/export/trips.xlsx
index 3201c66bb..3549a372e 100644
--- a/templates/export/trips.xlsx
+++ b/templates/export/trips.xlsx
Binary files differ