aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports/Trips.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/reports/Trips.java')
-rw-r--r--src/org/traccar/reports/Trips.java22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/org/traccar/reports/Trips.java b/src/org/traccar/reports/Trips.java
index 27863d877..705644849 100644
--- a/src/org/traccar/reports/Trips.java
+++ b/src/org/traccar/reports/Trips.java
@@ -187,20 +187,18 @@ public final class Trips {
for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) {
Context.getPermissionsManager().checkDevice(userId, deviceId);
Collection<TripReport> trips = detectTrips(deviceId, from, to);
- if (!trips.isEmpty()) {
- DeviceReport deviceTrips = new DeviceReport();
- Device device = Context.getIdentityManager().getDeviceById(deviceId);
- deviceTrips.setDeviceName(device.getName());
- sheetNames.add(deviceTrips.getDeviceName());
- if (device.getGroupId() != 0) {
- Group group = Context.getDeviceManager().getGroupById(device.getGroupId());
- if (group != null) {
- deviceTrips.setGroupName(group.getName());
- }
+ DeviceReport deviceTrips = new DeviceReport();
+ Device device = Context.getIdentityManager().getDeviceById(deviceId);
+ deviceTrips.setDeviceName(device.getName());
+ sheetNames.add(deviceTrips.getDeviceName());
+ if (device.getGroupId() != 0) {
+ Group group = Context.getDeviceManager().getGroupById(device.getGroupId());
+ if (group != null) {
+ deviceTrips.setGroupName(group.getName());
}
- deviceTrips.setObjects(detectTrips(deviceId, from, to));
- devicesTrips.add(deviceTrips);
}
+ deviceTrips.setObjects(trips);
+ devicesTrips.add(deviceTrips);
}
String templatePath = Context.getConfig().getString("report.templatesPath",
"templates/export/");